From: Manuel López-Ibáñez Date: Fri, 22 Aug 2014 18:39:16 +0000 (+0000) Subject: c.opt (Wcomment): Use CPP, Var and LangEnabledBy. X-Git-Tag: releases/gcc-5.1.0~5232 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=596e808cf6cc91f556838099b832bd01ce71e828;p=thirdparty%2Fgcc.git c.opt (Wcomment): Use CPP, Var and LangEnabledBy. gcc/c-family/ChangeLog: 2014-08-22 Manuel López-Ibáñez * c.opt (Wcomment): Use CPP, Var and LangEnabledBy. (Wmultichar): Likewise. (Wdate-time): Use C-family languages instead of Common. Use CPP and Var. * c-opts.c (c_common_handle_option): Do not handle the above options here. (sanitize_cpp_opts): Likewise. gcc/testsuite/ChangeLog: 2014-08-22 Manuel López-Ibáñez * g++.dg/warn/wdate-time.C: Remove. * gcc.dg/wdate-time.c: Move from here... * c-c++-common/wdate-time.c: ... to here. From-SVN: r214350 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index e8673b54d287..3bc50ef25261 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,13 @@ +2014-08-22 Manuel López-Ibáñez + + * c.opt (Wcomment): Use CPP, Var and LangEnabledBy. + (Wmultichar): Likewise. + (Wdate-time): Use C-family languages instead of Common. Use CPP + and Var. + * c-opts.c (c_common_handle_option): Do not handle the above + options here. + (sanitize_cpp_opts): Likewise. + 2014-08-21 Manuel López-Ibáñez PR fortran/44054 diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c index 5cae2b8e8d14..ddc480be1dd1 100644 --- a/gcc/c-family/c-opts.c +++ b/gcc/c-family/c-opts.c @@ -382,7 +382,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, /* ??? Don't add new options here. Use LangEnabledBy in c.opt. */ cpp_opts->warn_trigraphs = value; - cpp_opts->warn_comments = value; cpp_opts->warn_num_sign_change = value; break; @@ -390,10 +389,6 @@ c_common_handle_option (size_t scode, const char *arg, int value, cpp_opts->warn_builtin_macro_redefined = value; break; - case OPT_Wcomment: - cpp_opts->warn_comments = value; - break; - case OPT_Wc___compat: cpp_opts->warn_cxx_operator_names = value; break; @@ -421,12 +416,8 @@ c_common_handle_option (size_t scode, const char *arg, int value, case OPT_Wmissing_include_dirs: cpp_opts->warn_missing_include_dirs = value; break; - - case OPT_Wmultichar: - cpp_opts->warn_multichar = value; - break; - case OPT_Wnormalized_: + /* FIXME: Move all this to c.opt. */ if (kind == DK_ERROR) { gcc_assert (!arg); @@ -1310,7 +1301,6 @@ sanitize_cpp_opts (void) cpp_opts->unsigned_char = !flag_signed_char; cpp_opts->stdc_0_in_system_headers = STDC_0_IN_SYSTEM_HEADERS; - cpp_opts->warn_date_time = cpp_warn_date_time; cpp_opts->cpp_warn_c90_c99_compat = warn_c90_c99_compat; /* Wlong-long is disabled by default. It is enabled by: diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index f33a42578f80..140e89f613ca 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -328,7 +328,7 @@ C ObjC C++ ObjC++ Var(warn_clobbered) Warning EnabledBy(Wextra) Warn about variables that might be changed by \"longjmp\" or \"vfork\" Wcomment -C ObjC C++ ObjC++ Warning +C ObjC C++ ObjC++ CPP(warn_comments) Var(cpp_warn_comment) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) Warn about possibly nested block comments, and C++ comments spanning more than one physical line Wcomments @@ -598,7 +598,7 @@ Wmudflap C ObjC C++ ObjC++ Ignore Warn(switch %qs is no longer supported) Wmultichar -C ObjC C++ ObjC++ Warning +C ObjC C++ ObjC++ CPP(warn_multichar) Var(cpp_warn_multichar) Warning Warn about use of multi-character character constants Wnarrowing @@ -702,7 +702,7 @@ C ObjC C++ ObjC++ Var(warn_pragmas) Init(1) Warning Warn about misuses of pragmas Wdate-time -Common Var(cpp_warn_date_time) Warning +C ObjC C++ ObjC++ CPP(warn_date_time) Var(cpp_warn_date_time) Warning Warn about __TIME__, __DATE__ and __TIMESTAMP__ usage Wproperty-assign-default diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8dd980b8a6f5..b47e09044236 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2014-08-22 Manuel López-Ibáñez + + * g++.dg/warn/wdate-time.C: Remove. + * gcc.dg/wdate-time.c: Move from here... + * c-c++-common/wdate-time.c: ... to here. + 2014-08-22 Joost VandeVondele * gfortran.dg/use_without_only_1.f90: New test. diff --git a/gcc/testsuite/c-c++-common/wdate-time.c b/gcc/testsuite/c-c++-common/wdate-time.c new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/gcc/testsuite/g++.dg/warn/wdate-time.C b/gcc/testsuite/g++.dg/warn/wdate-time.C deleted file mode 100644 index 0ff27b4cd6fc..000000000000 --- a/gcc/testsuite/g++.dg/warn/wdate-time.C +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-Wdate-time" } */ - -const char time[] = __TIME__; /* { dg-warning "might prevent reproducible builds" } */ -const char date[] = __DATE__; /* { dg-warning "might prevent reproducible builds" } */ -const char timestamp[] = __TIMESTAMP__; /* { dg-warning "might prevent reproducible builds" } */ diff --git a/gcc/testsuite/gcc.dg/wdate-time.c b/gcc/testsuite/gcc.dg/wdate-time.c deleted file mode 100644 index 0ff27b4cd6fc..000000000000 --- a/gcc/testsuite/gcc.dg/wdate-time.c +++ /dev/null @@ -1,6 +0,0 @@ -/* { dg-do compile } */ -/* { dg-options "-Wdate-time" } */ - -const char time[] = __TIME__; /* { dg-warning "might prevent reproducible builds" } */ -const char date[] = __DATE__; /* { dg-warning "might prevent reproducible builds" } */ -const char timestamp[] = __TIMESTAMP__; /* { dg-warning "might prevent reproducible builds" } */