diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2025-09-02 15:58:26 -0700 |
commit | 071b4126c613881f4cb25b4e5c39032964827f88 (patch) | |
tree | 7ed805786566918630d1d617b1ed8f7310f5fd8e /libcpp/init.cc | |
parent | 845d23f3ea08ba873197c275a8857eee7edad996 (diff) | |
parent | caa1c2f42691d68af4d894a5c3e700ecd2dba080 (diff) | |
download | gcc-devel/gfortran-test.zip gcc-devel/gfortran-test.tar.gz gcc-devel/gfortran-test.tar.bz2 |
Merge branch 'master' into gfortran-testdevel/gfortran-test
Diffstat (limited to 'libcpp/init.cc')
-rw-r--r-- | libcpp/init.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libcpp/init.cc b/libcpp/init.cc index e9732af..eb495e2 100644 --- a/libcpp/init.cc +++ b/libcpp/init.cc @@ -246,6 +246,7 @@ cpp_create_reader (enum c_lang lang, cpp_hash_table *table, CPP_OPTION (pfile, dollars_in_ident) = 1; CPP_OPTION (pfile, warn_dollars) = 1; CPP_OPTION (pfile, warn_variadic_macros) = 1; + CPP_OPTION (pfile, suppress_builtin_macro_warnings) = 0; CPP_OPTION (pfile, warn_builtin_macro_redefined) = 1; CPP_OPTION (pfile, cpp_warn_implicit_fallthrough) = 0; CPP_OPTION (pfile, warn_header_guard) = 0; @@ -593,6 +594,8 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) && (! CPP_OPTION (pfile, stdc_0_in_system_headers) || CPP_OPTION (pfile, std))) _cpp_define_builtin (pfile, "__STDC__ 1"); + else if (CPP_OPTION (pfile, cplusplus)) + cpp_warn (pfile, "__STDC__"); if (CPP_OPTION (pfile, cplusplus)) { @@ -618,6 +621,14 @@ cpp_init_builtins (cpp_reader *pfile, int hosted) _cpp_define_builtin (pfile, "__cplusplus 201103L"); else _cpp_define_builtin (pfile, "__cplusplus 199711L"); + cpp_warn (pfile, "__cplusplus"); + if (CPP_OPTION (pfile, lang) >= CLK_GNUCXX11) + { + cpp_warn (pfile, "__STDC_VERSION__"); + cpp_warn (pfile, "__STDC_MB_MIGHT_NEQ_WC__"); + if (CPP_OPTION (pfile, lang) < CLK_GNUCXX23) + cpp_warn (pfile, "__STDCPP_STRICT_POINTER_SAFETY__"); + } } else if (CPP_OPTION (pfile, lang) == CLK_ASM) _cpp_define_builtin (pfile, "__ASSEMBLER__ 1"); |