作者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)
推 moonshade:可以指定standard喔~~~第一次知道XD 140.112.48.60 05/13
推 gwliao:gcc3新增的, 2.95只有-ansi就是c89 :P140.112.230.224 05/13
推 mondschatten:我都習慣用C99,可是有些不支援就是了 140.112.48.60 05/13
→ gwliao:c99有支援...但gcc3.4說"not fully supported"140.112.230.224 05/14
→ gwliao:你應該是gnu89(內定),C90+gnu的延伸(含一些C99)140.112.230.224 05/14
→ gwliao:以前我也以為自己的code是ANSI C,但也是gnu89 Orz140.112.230.224 05/14