public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/65403] New: -Wno-error=<not implemented> is an error
@ 2015-03-12 14:36 rguenth at gcc dot gnu.org
  2015-03-12 14:38 ` [Bug c/65403] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-12 14:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65403

            Bug ID: 65403
           Summary: -Wno-error=<not implemented> is an error
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org

If you want to silence warnings you can use -Wno-XXX without caring about
whether
a compiler implements -WXXX already.  This doesn't seem to work with
-Wno-error=XXX which errors on unknown XXX.

It seems to me that we should treat -W[no-]error=XXX the same as -Wno-XXX
for unknown XXX as it certainly will enable/disable errors for the warning XXX
both if present or not present (no warnings anyway).

> gcc-5 -Wall -Werror -Wno-error=logical-not-parentheses -S t.c
> gcc-4.8 -Wall -Werror -Wno-error=logical-not-parentheses -S t.c
cc1: error: -Werror=logical-not-parentheses: no option
-Wlogical-not-parentheses

> gcc-5 -Wno-error=foo -S t.c
cc1: error: -Werror=foo: no option -Wfoo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/65403] -Wno-error=<not implemented> is an error
  2015-03-12 14:36 [Bug c/65403] New: -Wno-error=<not implemented> is an error rguenth at gcc dot gnu.org
@ 2015-03-12 14:38 ` rguenth at gcc dot gnu.org
  2015-03-12 16:09 ` manu at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-12 14:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65403

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Besides that the error also complains about -Werror= instead of -Wno-error=


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/65403] -Wno-error=<not implemented> is an error
  2015-03-12 14:36 [Bug c/65403] New: -Wno-error=<not implemented> is an error rguenth at gcc dot gnu.org
  2015-03-12 14:38 ` [Bug c/65403] " rguenth at gcc dot gnu.org
@ 2015-03-12 16:09 ` manu at gcc dot gnu.org
  2015-03-12 17:10 ` manu at gcc dot gnu.org
  2021-08-12 16:48 ` alexhenrie24 at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2015-03-12 16:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65403

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-03-12
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
For fixing the output, the following should be enough:

Index: opts.c
===================================================================
--- opts.c      (revision 221118)
+++ opts.c      (working copy)
@@ -2341,11 +2341,12 @@ enable_warning_as_error (const char *arg
   new_option[0] = 'W';
   strcpy (new_option + 1, arg);
   option_index = find_opt (new_option, lang_mask);
   if (option_index == OPT_SPECIAL_unknown)
     {
-      error_at (loc, "-Werror=%s: no option -%s", arg, new_option);
+      error_at (loc, "-W%s=%s: no option -%s",
+               value ? "error" : "no-error", arg, new_option);
     }
   else
     {
       const diagnostic_t kind = value ? DK_ERROR : DK_WARNING;
>From gcc-bugs-return-480201-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 12 16:11:04 2015
Return-Path: <gcc-bugs-return-480201-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 92270 invoked by alias); 12 Mar 2015 16:11:04 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 80354 invoked by uid 55); 12 Mar 2015 16:10:59 -0000
From: "paul.richard.thomas at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/65045] [4.8/4.9/5 Regression] ICE when using the same name for a block and a variable.
Date: Thu, 12 Mar 2015 16:11:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 4.9.2
X-Bugzilla-Keywords: error-recovery
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paul.richard.thomas at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: pault at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.5
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65045-4-RSELs5aMGz@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65045-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65045-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01345.txt.bz2
Content-length: 1106

https://gcc.gnu.org/bugzilla/show_bug.cgi?ide045

--- Comment #4 from paul.richard.thomas at gmail dot com <paul.richard.thomas at gmail dot com> ---
Hi Tobias,

Thanks. I found one or two similar testcases that still fail. As soon
as I find some time, I will submit a complete fix.

How was the sailing in Scotland?

Paul

On 12 March 2015 at 16:59, burnus at gcc dot gnu.org
<gcc-bugzilla@gcc.gnu.org> wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?ide045
>
> Tobias Burnus <burnus at gcc dot gnu.org> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |burnus at gcc dot gnu.org
>
> --- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
> (In reply to Paul Thomas from comment #2)
>> The attached patch bootstraps and regtests on trunk with FC21/x86_64.
>
> Looks good to me - okay with a test case and a ChangeLog.
>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.
> You are the assignee for the bug.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/65403] -Wno-error=<not implemented> is an error
  2015-03-12 14:36 [Bug c/65403] New: -Wno-error=<not implemented> is an error rguenth at gcc dot gnu.org
  2015-03-12 14:38 ` [Bug c/65403] " rguenth at gcc dot gnu.org
  2015-03-12 16:09 ` manu at gcc dot gnu.org
@ 2015-03-12 17:10 ` manu at gcc dot gnu.org
  2021-08-12 16:48 ` alexhenrie24 at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: manu at gcc dot gnu.org @ 2015-03-12 17:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65403

--- Comment #3 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
For harmonizing how -Wno-X and -Wno-error=X work, it is a bit more convoluted.
This mostly works:

Index: opts-global.c
===================================================================
--- opts-global.c       (revision 221118)
+++ opts-global.c       (working copy)
@@ -139,11 +139,11 @@ complain_wrong_lang (const struct cl_dec
    prevented a diagnostic. Otherwise, we just ignore them.  Note that
    if we do complain, it is only as a warning, not an error; passing
    the compiler an unrecognized -Wno-* option should never change
    whether the compilation succeeds or fails.  */

-static void
+void
 postpone_unknown_option_warning (const char *opt)
 {
   ignored_options.safe_push (opt);
 }

@@ -152,15 +152,20 @@ postpone_unknown_option_warning (const c
 void
 print_ignored_options (void)
 {
   while (!ignored_options.is_empty ())
     {
-      const char *opt;
-
-      opt = ignored_options.pop ();
-      warning_at (UNKNOWN_LOCATION, 0,
-                 "unrecognized command line option %qs", opt);
+      const char * opt = ignored_options.pop ();
+      if (strcmp (opt, "-Wno-error=") == 0)
+       {
+         const char * w_opt = opt + strlen ("-Wno-error=");
+         warning_at (UNKNOWN_LOCATION, 0, "-Wno-error=%s: no option -W%s",
+                     w_opt, w_opt);
+       }
+      else
+       warning_at (UNKNOWN_LOCATION, 0,
+                   "unrecognized command line option %qs", opt);
     }
 }

 /* Handle an unknown option DECODED, returning true if an error should
    be given.  */

Index: opts.h
===================================================================
--- opts.h      (revision 221118)
+++ opts.h      (working copy)
@@ -400,6 +400,7 @@ extern void default_options_optimization
 extern void set_struct_debug_option (struct gcc_options *opts,
                                     location_t loc,
                                     const char *value);
 extern bool opt_enum_arg_to_value (size_t opt_index, const char *arg,
                                   int *value, unsigned int lang_mask);
+extern void postpone_unknown_option_warning (const char *opt);
 #endif
Index: opts.c
===================================================================
--- opts.c      (revision 221118)
+++ opts.c      (working copy)
@@ -2335,17 +2335,23 @@ enable_warning_as_error (const char *arg
                         location_t loc, diagnostic_context *dc)
 {
   char *new_option;
   int option_index;

-  new_option = XNEWVEC (char, strlen (arg) + 2);
+  new_option = XNEWVEC (char, strlen (arg) + strlen ("-Wno-error=") + 1);
   new_option[0] = 'W';
   strcpy (new_option + 1, arg);
   option_index = find_opt (new_option, lang_mask);
   if (option_index == OPT_SPECIAL_unknown)
     {
-      error_at (loc, "-Werror=%s: no option -%s", arg, new_option);
+      if (value)
+       error_at (loc, "-Werror=%s: no option -%s",  arg, new_option);
+      else
+       strcpy (new_option, "-Wno-error=");
+       strcat (new_option, arg);
+       postpone_unknown_option_warning (new_option);
+       return;
     }
   else
     {
       const diagnostic_t kind = value ? DK_ERROR : DK_WARNING;


with some caveats:

* It is a bit too convoluted
* In principle enable_warning_as_error() can be called with a loc !=
UNKNOWN_LOCATION, thus we should record this location for reporting the
warning.
>From gcc-bugs-return-480212-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 12 17:19:17 2015
Return-Path: <gcc-bugs-return-480212-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27450 invoked by alias); 12 Mar 2015 17:19:17 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 27401 invoked by uid 48); 12 Mar 2015 17:19:13 -0000
From: "manu at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/65403] -Wno-error=<not implemented> is an error
Date: Thu, 12 Mar 2015 17:19:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: manu at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-65403-4-Kn3lUypK9R@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-65403-4@http.gcc.gnu.org/bugzilla/>
References: <bug-65403-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01356.txt.bz2
Content-length: 3559

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65403

--- Comment #4 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
In fact, this version seems much more straightforward:

Index: opts-global.c
===================================================================
--- opts-global.c       (revision 221118)
+++ opts-global.c       (working copy)
@@ -60,13 +60,12 @@ along with GCC; see the file COPYING3.  
 #include "toplev.h"
 #include "tree-pass.h"
 #include "context.h"
 #include "asan.h"

-typedef const char *const_char_p; /* For DEF_VEC_P.  */
-
-static vec<const_char_p> ignored_options;
+static vec<const char *> ignored_options;
+static vec<const char *> ignored_wnoerror_options;

 /* Input file names.  */
 const char **in_fnames;
 unsigned num_in_fnames;

@@ -145,23 +144,35 @@ static void
 postpone_unknown_option_warning (const char *opt)
 {
   ignored_options.safe_push (opt);
 }

+/* This function is equivalent to the above, but it should be used to
+   buffer options passed to -Wno-error=.  */
+void
+postpone_unknown_wnoerror_warning (const char *opt)
+{
+  ignored_wnoerror_options.safe_push (opt);
+}
+
 /* Produce a warning for each option previously buffered.  */

 void
 print_ignored_options (void)
 {
   while (!ignored_options.is_empty ())
     {
-      const char *opt;
-
-      opt = ignored_options.pop ();
+      const char * opt = ignored_options.pop ();
       warning_at (UNKNOWN_LOCATION, 0,
                  "unrecognized command line option %qs", opt);
     }
+  while (!ignored_wnoerror_options.is_empty ())
+    {
+      const char * opt = ignored_wnoerror_options.pop ();
+      warning_at (UNKNOWN_LOCATION, 0,
+                 "-Wno-error=%s: no option -W%s", opt, opt);
+    }
 }

 /* Handle an unknown option DECODED, returning true if an error should
    be given.  */

Index: opts.c
===================================================================
--- opts.c      (revision 221118)
+++ opts.c      (working copy)
@@ -2341,11 +2341,14 @@ enable_warning_as_error (const char *arg
   new_option[0] = 'W';
   strcpy (new_option + 1, arg);
   option_index = find_opt (new_option, lang_mask);
   if (option_index == OPT_SPECIAL_unknown)
     {
-      error_at (loc, "-Werror=%s: no option -%s", arg, new_option);
+      if (value)
+       error_at (loc, "-Werror=%s: no option -%s",  arg, new_option);
+      else
+       postpone_unknown_wnoerror_warning (arg);
     }
   else
     {
       const diagnostic_t kind = value ? DK_ERROR : DK_WARNING;

Index: opts.h
===================================================================
--- opts.h      (revision 221118)
+++ opts.h      (working copy)
@@ -400,6 +400,7 @@ extern void default_options_optimization
 extern void set_struct_debug_option (struct gcc_options *opts,
                                     location_t loc,
                                     const char *value);
 extern bool opt_enum_arg_to_value (size_t opt_index, const char *arg,
                                   int *value, unsigned int lang_mask);
+extern void postpone_unknown_wnoerror_warning (const char *opt);
 #endif
>From gcc-bugs-return-480214-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Mar 12 17:26:53 2015
Return-Path: <gcc-bugs-return-480214-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 63703 invoked by alias); 12 Mar 2015 17:26:53 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 63203 invoked by uid 55); 12 Mar 2015 17:26:49 -0000
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/60898] [4.8/4.9/5 Regression] model compile error with gfortran 4.7 and gcc 4.9
Date: Thu, 12 Mar 2015 17:26:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: fortran
X-Bugzilla-Version: 5.0
X-Bugzilla-Keywords: ice-on-valid-code, patch
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mikael at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P4
X-Bugzilla-Assigned-To: mikael at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.5
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60898-4-CZTZPyeHUX@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60898-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60898-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-03/txt/msg01358.txt.bz2
Content-length: 696

https://gcc.gnu.org/bugzilla/show_bug.cgi?id`898

--- Comment #25 from Mikael Morin <mikael at gcc dot gnu.org> ---
Author: mikael
Date: Thu Mar 12 17:26:17 2015
New Revision: 221400

URL: https://gcc.gnu.org/viewcvs?rev"1400&root=gcc&view=rev
Log:
    PR fortran/60898
fortran/
    * resolve.c (resolve_symbol): Check that the symbol found by
    name lookup really is the current symbol being resolved.
testsuite/
    * gfortran.dg/entry_20.f90: New.


Added:
    branches/gcc-4_8-branch/gcc/testsuite/gfortran.dg/entry_20.f90
Modified:
    branches/gcc-4_8-branch/gcc/fortran/ChangeLog
    branches/gcc-4_8-branch/gcc/fortran/resolve.c
    branches/gcc-4_8-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/65403] -Wno-error=<not implemented> is an error
  2015-03-12 14:36 [Bug c/65403] New: -Wno-error=<not implemented> is an error rguenth at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-03-12 17:10 ` manu at gcc dot gnu.org
@ 2021-08-12 16:48 ` alexhenrie24 at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: alexhenrie24 at gmail dot com @ 2021-08-12 16:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65403

--- Comment #15 from Alex Henrie <alexhenrie24 at gmail dot com> ---
Nicholas Guriev also sent a patch for this issue:

https://gcc.gnu.org/pipermail/gcc-patches/2021-June/573774.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-12 16:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-12 14:36 [Bug c/65403] New: -Wno-error=<not implemented> is an error rguenth at gcc dot gnu.org
2015-03-12 14:38 ` [Bug c/65403] " rguenth at gcc dot gnu.org
2015-03-12 16:09 ` manu at gcc dot gnu.org
2015-03-12 17:10 ` manu at gcc dot gnu.org
2021-08-12 16:48 ` alexhenrie24 at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).