2006-02-24

還沒吃東西就要噴東西, 竟然沒有死?

還沒吃東西就要噴東西, 竟然沒有死?This entry was originally published at 抓~ 抓到一隻瞌睡蟲
其實是在說下面這段程式…

1 #include <list>
2 #include <iostream>
3 using namespace std;
4 int main()
5 {
6 list<int> a;
7 a.pop_front();
8 a.pop_front();
9 a.pop_front();
10 a.pop_front();
11 a.pop_front();
12 a.pop_front();
13 a.pop_front();
14 a.pop_front();
15 cout <<a.size()<<endl;
16 return 0;
17 }
在某台跑的結果是
alex@xxxxxx [17:33] ~> ./a.out
a.out in free(): error: malloc() has never been called
Abort
結果另外一台是
yhsung@oooo [5:20pm] ~> ./a.out
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
a.out in free(): warning: malloc() has never been called
0
另外試很多台, 看起來應該是要crash吧? @_@

沒有留言: