summaryrefslogtreecommitdiff
path: root/gnu/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2023-10-26 17:33:36 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2023-10-26 17:33:36 +0000
commitcc59e0a13df976e7e30d46ef2e72a7edee510096 (patch)
treec1782cfe76298d6eb68ec10ddd0698f6bef291e8 /gnu/usr.bin
parentbd709777fcd441e506eafcae282cdd2cca3e4c8e (diff)
Make gnu99 the default for gcc 3.3.6 and 4.2.1, not gnu89.
While these versions of gcc don't have full C99 support, it is better than defaulting to C89 when building modern software. OK deraadt@
Diffstat (limited to 'gnu/usr.bin')
-rw-r--r--gnu/usr.bin/gcc/gcc/c-opts.c9
-rw-r--r--gnu/usr.bin/gcc/gcc/doc/cppopts.texi4
-rw-r--r--gnu/usr.bin/gcc/gcc/doc/invoke.texi6
3 files changed, 12 insertions, 7 deletions
diff --git a/gnu/usr.bin/gcc/gcc/c-opts.c b/gnu/usr.bin/gcc/gcc/c-opts.c
index d20dec4cf5c..8e8d9ced5eb 100644
--- a/gnu/usr.bin/gcc/gcc/c-opts.c
+++ b/gnu/usr.bin/gcc/gcc/c-opts.c
@@ -509,7 +509,7 @@ c_common_init_options (lang)
#endif
c_language = lang;
- parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC89 : CLK_GNUCXX);
+ parse_in = cpp_create_reader (lang == clk_c ? CLK_GNUC99 : CLK_GNUCXX);
cpp_opts = cpp_get_options (parse_in);
if (flag_objc)
cpp_opts->objc = 1;
@@ -517,7 +517,12 @@ c_common_init_options (lang)
flag_const_strings = (lang == clk_cplusplus);
warn_pointer_arith = (lang == clk_cplusplus);
if (lang == clk_c)
- warn_sign_compare = -1;
+ {
+ /* The default for C is gnu99. */
+ set_std_c99 (false /* ISO */);
+
+ warn_sign_compare = -1;
+ }
}
static char *bad_option;
diff --git a/gnu/usr.bin/gcc/gcc/doc/cppopts.texi b/gnu/usr.bin/gcc/gcc/doc/cppopts.texi
index 1cc688a4730..b0a5f29af24 100644
--- a/gnu/usr.bin/gcc/gcc/doc/cppopts.texi
+++ b/gnu/usr.bin/gcc/gcc/doc/cppopts.texi
@@ -351,11 +351,11 @@ The revised ISO C standard, published in December 1999. Before
publication, this was known as C9X@.
@item gnu89
-The 1990 C standard plus GNU extensions. This is the default.
+The 1990 C standard plus GNU extensions.
@item gnu99
@itemx gnu9x
-The 1999 C standard plus GNU extensions.
+The 1999 C standard plus GNU extensions This is the default..
@item c++98
The 1998 ISO C++ standard plus amendments.
diff --git a/gnu/usr.bin/gcc/gcc/doc/invoke.texi b/gnu/usr.bin/gcc/gcc/doc/invoke.texi
index b2b61f6758a..582612452e1 100644
--- a/gnu/usr.bin/gcc/gcc/doc/invoke.texi
+++ b/gnu/usr.bin/gcc/gcc/doc/invoke.texi
@@ -1015,12 +1015,12 @@ ISO C99. Note that this standard is not yet fully supported; see
names @samp{c9x} and @samp{iso9899:199x} are deprecated.
@item gnu89
-Default, ISO C90 plus GNU extensions (including some C99 features).
+ISO C90 plus GNU extensions (including some C99 features).
@item gnu99
@itemx gnu9x
-ISO C99 plus GNU extensions. When ISO C99 is fully implemented in GCC,
-this will become the default. The name @samp{gnu9x} is deprecated.
+Default, ISO C99 plus GNU extensions.
+The name @samp{gnu9x} is deprecated.
@item c++98
The 1998 ISO C++ standard plus amendments.