作者gwliao (gwliao)
看板NTUGIEE_EDA
标题Re: [Sun] gcc4 installed
时间Fri May 13 15:46:16 2005
※ 引述《yellowfishie (喵喵喵喵~~~)》之铭言:
: 目前在 Sun 的机器 (edasun、edasolaris、eda5) 装了 gcc-4.0.0
: 目前预设的 gcc 仍以 gcc 3.4.2 为主,
: 要使用 gcc 4.0.0 的请用 gcc4 或 g++4 进行编绎 :)
我用gcc 3.3.5 :P 这是debain建议的版本
gcc 3.4还太新, 还有很多问题
gcc 4...........根本没在package中, 所以稳定度堪虑 Orz
要服用的人, 请深吸一口气 XD
( 其实我有灌gcc 3.3.5, 3.4.4, 2.95.4 XD )
其实大家写程式符合language standard的话, 问题就不会这麽多!
-std=
Determine the language standard. This option is currently only
supported when compiling C or C++. A value for this option must be
provided; possible values are
c89
iso9899:1990
ISO C90 (same as -ansi).
c89是C程式的建议. c99的话, 对其他compiler可能会出包 :P
gnu89
Default, ISO C90 plus GNU extensions (including some C99 fea-
tures).
default是gnu89, 习惯这个会死人 Orz
gnu99
gnu9x
ISO C99 plus GNU extensions. When ISO C99 is fully implemented
in GCC, this will become the default. The name gnu9x is depre-
cated.
gnu++98
The same as -std=c++98 plus GNU extensions. This is the
default for C++ code.
这两个也一样, 习惯extensions的话, porting会出事 :P
c++98
The 1998 ISO C++ standard plus amendments.
这个是C++程式的建议值
我的command是"g++ -Wall -std=c++98", 然後修到一个warningmessage都没有为止,
这样porting的问题会减少很多 :)
C程式? 别人写的用gcc,
自己写的code, 我都用g++去compile XD
没STL+boost,我觉得写程式是一件很累的事 :P
(所以自从我会STL後, 应该没再用pure C去写程式了)
PS: .NET如何设定成这样? 知道的人教一下 Orz 我需要
(上一次用MS的IDE是VC5, 8年前的事情)
--
※ 发信站: 批踢踢实业坊(ptt.cc)
※ 编辑: gwliao 来自: 140.112.230.224 (05/13 15:58)
1F:推 moonshade:可以指定standard喔~~~第一次知道XD 140.112.48.60 05/13
2F:推 gwliao:gcc3新增的, 2.95只有-ansi就是c89 :P140.112.230.224 05/13
3F:推 mondschatten:我都习惯用C99,可是有些不支援就是了 140.112.48.60 05/13
4F:→ gwliao:c99有支援...但gcc3.4说"not fully supported"140.112.230.224 05/14
5F:→ gwliao:你应该是gnu89(内定),C90+gnu的延伸(含一些C99)140.112.230.224 05/14
6F:→ gwliao:以前我也以为自己的code是ANSI C,但也是gnu89 Orz140.112.230.224 05/14