C dialect options
ISO C90 | ISO C99 |
---|---|
-ansi, -std=c89, iso9899:1990, (ISO C90) | -std=c99, iso9899:1999 |
-std=iso9899:199409 (ISO C90 as modified in amendment 1) | -std=gnu99 (iso c99 + gnu extensions, gcc default) |
-std=gnu89 (iso c90 + gnu extensions + some c99 features) |
ISO C11 | ISO C18 |
---|---|
-std=c11 | -std=c17, -std=c18 |
- iso9899 (C Lang Spec Number of ISO)
-ansi
for C++ mode means that remove conflics gnu extensions with ISO C++- The word
ansi
means American Nation Standard Institute, c89 means ansi 89 (the first standard version), however c99 is iso 1999.The history isansi89 -> iso90(same with ansi89) -> iso99
, in other words, iso take the ownership of the C Lang standard from ansi. - c18 is created on 2017 and released on 2018, so it’s called c17 or c18. It contains no new features, just corrections
Runtime Environments
std | no_std |
---|---|
-fhosted (takes place in a hosted env) | -fno-hosted |
-fno-freestanding | -ffreestanding |
-fno-builtin, -fno-builtin- |
-
fno-builtin: Don’t recognize built-in functions that do not begin with
__builtin_
as prefix,__built_in_xxx
always existed. -
fno-builtin-
such as `-fno-builtin-printf`. -
on
no_std
env using__builtin_xxx
instead