在suse 9 gcc version 3.3.3 (SuSE Linux)时候的编译程序没有问题。 现在在gentoo上编译 gcc version 4.1.1 (Gentoo 4.1.1) 出现一堆问题, if g++ -DHAVE_CONFIG_H -I. -I. -I../.. -I ../netlib2/include -I ../netlib2/src -g -O2 -MT test.o -MD -MP -MF ".deps/test.Tpo" -c -o test.o test.cpp; \ then mv -f ".deps/test.Tpo" ".deps/test.Po"; else rm -f ".deps/test.Tpo"; exit 1; fi /usr/lib/gcc/i686-pc-linux-gn...
by ruchong - C/C++ - 2008-06-05 22:17:00 阅读(6343) 回复(2)
为什么输出的结果是2 3 1这样的顺寻,而不是 1th:。。。 2th:。。。 3th:。。。 我是FreeBSD里的Konsole里编辑运行的,希望高手能指导一下,本人是个新手。 [ 本帖最后由 VirusInLife 于 2008-7-9 13:48 编辑 ]
gcc 中,调用者保存的局部变量的入栈顺序跟什么有关阿?是顺序?逆序? 《深入理解计算机系统》书上有的例子显示是逆序的,可是gcc编译产生的是顺序的? 我知道函数参数是按逆序入栈的 。
% cat datafile northwest NW Joel Craig 3.0 .98 3 4 western WE Sharon Kelly 5.3 .97 5 23 southwest SW Chris Foster 2.7 .8 2 18 southern SO May Chin 5.1 .95 4 15 southeast SE Derek Johnson 4.0 .7 4 17 eastern EA Susan Beal 4.4 .84 5 20 northea...
我记得好像看到某个文章里面说C语言里面的函数参数压栈顺序与求值顺序是两回事。 压栈顺序是从右到左,而求值顺序则是undefined的,由编译器实现决定,例如 [code] int g(); int h(); int f(int c, int b); ... f(g(), h()); --(1) ... [/code] (1)处f函数调用,先计算顺序g,还是先计算h这个由编译器决定。而参数的压栈则是固定的由右到左,现将h的结果压栈,然后g的结果压栈。 因为手上没有什么编译器,不太好测试。所以...
class A { public: void print() { cout << "A print()" << endl; } }; class B : public A { public: void print() { cout << "B print()" << endl; } }; int main() { A* pa = new A; pa->print(); ((B*)pa)->print(); } A print() B print() ===================================================================== class...
我先使用flow-capture -n 144 -e 1440 -w /home/name/flow01抓取一个出口的信息,存放在flow01目录中。 我们这里还有另一个出口,我想同时抓取,但想保存在另外一个目录中,例如flow02,我试过再执行flow-capture -n 144 -e 1440 -w /home/name/flow02,没有数据产生,不知道为什么,难道一台主机只能进行一个抓取数据的动作? 急啊,请高人们指点指点!!!
在GCC4.0和VS2005中好像都是从右至左,有哪个编译器是从左至右阿? [ 本帖最后由 Godbach 于 2007-10-31 22:13 编辑 ]
[quote] [root@test lib]# cat a.txt 111111111 222222222 ls - list directory contents 333333333 444444444 555555555 ls [OPTION]... [FILE]... 666666666 777777777 [root@test lib]# [root@test lib]# cat b.sed #!/bin/sed -f /ls/ { n d } [root@test lib]# [root@test lib]# ./b.sed a.txt 111111111 222222222 ls - list directory contents 444444444 555555555 ls [OPTION]... [FILE]... 777777777 [root@test li...