-ansi Support all ANSI standard C programs.
This turns off certain features of GNU C that are incompatible with ANSI C, such as the asm,
inline and typeof keywords, and predefined macros such as unix and vax that identify the type
of system you are using. It also enables the undesirable and rarely used ANSI trigraph fea-
ture, and disallows `$' as part of identifiers.
The alternate keywords __asm__, __extension__, __inline__ and __typeof__ continue to work de-
spite `-ansi'. You would not want to use them in an ANSI C program, of course, but it is use-
ful to put them in header files that might be included in compilations done with `-ansi'. Al-
ternate predefined macros such as __unix__ and __vax__ are also available, with or without
`-ansi'.
The `-ansi' option does not cause non-ANSI programs to be rejected gratuitously. For that,
`-pedantic' is required in addition to `-ansi'.
The preprocessor predefines a macro __STRICT_ANSI__ when you use the `-ansi' option. Some
header files may notice this macro and refrain from declaring certain functions or defining
certain macros that the ANSI standard doesn't call for; this is to avoid interfering with any
programs that might use these names for other things.
-pedantic
Issue all the warnings demanded by strict ANSI standard C; reject all programs that use forbid-
den extensions.
Valid ANSI standard C programs should compile properly with or without this option (though a
rare few will require `-ansi'). However, without this option, certain GNU extensions and tra-
ditional C features are supported as well. With this option, they are rejected. There is no
reason to use this option; it exists only to satisfy pedants.
`-pedantic' does not cause warning messages for use of the alternate keywords whose names begin
and end with `__'. Pedantic warnings are also disabled in the expression that follows __exten-
sion__. However, only system header files should use these escape routes; application programs
should avoid them.
-Wall All of the above `-W' options combined. These are all the options which pertain to usage that
we recommend avoiding and that we believe is easy to avoid, even in conjunction with macros.
질문하시기 전에 man 페이지를 참고해주시기 바랍니다. :-)
ansi 옵션은 ANSI 표준으로 컴파일 하는거고 pedantic은 ANSI가 아닌 비표준 사양은 불평하는 메시지를 내라는 거고요.
Wall은 waning을 all 켜라는 겁니다. 컴파일 경고 메시지를 다 켜는 거죠.
-Wall이 모든 경고를 다 켠다고 생각해도 무방할 정도로 많은 경고를 냅니다만,
흔히 아는 것 처럼 모든 경고를 다 키진 않습니다. :lol:
man page를 더 잘 읽어 보시면..
Quote:
The remaining `-W...' options are not implied by `-Wall' because they warn about constructions that we
consider reasonable to use, on occasion, in clean programs.
remaining "-W.." options에 무려 16개나 더 있군요..
wowlinux 7.1에서 2.96으로 man 해보았습니다.
man gcc[code:1] -ansi Support a
man gcc
질문하시기 전에 man 페이지를 참고해주시기 바랍니다. :-)
ansi 옵션은 ANSI 표준으로 컴파일 하는거고 pedantic은 ANSI가 아닌 비표준 사양은 불평하는 메시지를 내라는 거고요.
Wall은 waning을 all 켜라는 겁니다. 컴파일 경고 메시지를 다 켜는 거죠.
rommance.net
송지석님께 딴지 걸려는 것은 아니구요.. :D -Wall이 모든
송지석님께 딴지 걸려는 것은 아니구요.. :D
-Wall이 모든 경고를 다 켠다고 생각해도 무방할 정도로 많은 경고를 냅니다만,
흔히 아는 것 처럼 모든 경고를 다 키진 않습니다. :lol:
man page를 더 잘 읽어 보시면..
remaining "-W.." options에 무려 16개나 더 있군요..
wowlinux 7.1에서 2.96으로 man 해보았습니다.
참고하세요..
---
http://coolengineer.com
댓글 달기