public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/114191] New: Flags "Warning" and "Target" don't mix well in target.opt files
@ 2024-03-01 15:52 gjl at gcc dot gnu.org
  2024-03-04  8:14 ` [Bug other/114191] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-03-01 15:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114191
           Summary: Flags "Warning" and "Target" don't mix well in
                    target.opt files
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

In an .opt file, a backend can define target-specific diagnostic options, for
example gcc/config/avr/avr.opt has:

Wmisspelled-isr
Warning C C++ Var(avr_warn_misspelled_isr) Init(1)
Warn if the ISR is misspelled, ...

This is a "Target" option however (so it should be listed with --help=target,
which it currently is not). However, specifying the "Target" flag in avr.opt
makes the option no more recognizable:

$ avr-gcc main.c -c -Wall -Wmisspelled-isr
cc1: error: unrecognized command-line option '-Wmisspelled-isr'

I can reproduce this for target avr, but it likely affects all other targets as
well.

Set the component to "other". As it appears, there is no bugzilla component for
such internal problems.

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

* [Bug other/114191] Flags "Warning" and "Target" don't mix well in target.opt files
  2024-03-01 15:52 [Bug other/114191] New: Flags "Warning" and "Target" don't mix well in target.opt files gjl at gcc dot gnu.org
@ 2024-03-04  8:14 ` rguenth at gcc dot gnu.org
  2024-03-04  8:54 ` gjl at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2024-03-04  8:14 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |internal-improvement
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
I think there's no way to mark Warning options as target specific, 'Target'
isn't a flag, it's the main keyword.

How did you specify 'Target'?  I think that

Wmisspelled-isr
Target C C++ Var(avr_warn_misspelled_isr) Init(1)
Warn if the ISR is misspelled, ...

should eventually work?

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

* [Bug other/114191] Flags "Warning" and "Target" don't mix well in target.opt files
  2024-03-01 15:52 [Bug other/114191] New: Flags "Warning" and "Target" don't mix well in target.opt files gjl at gcc dot gnu.org
  2024-03-04  8:14 ` [Bug other/114191] " rguenth at gcc dot gnu.org
@ 2024-03-04  8:54 ` gjl at gcc dot gnu.org
  2024-03-04  9:34 ` gjl at gcc dot gnu.org
  2024-03-04 10:07 ` rguenther at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-03-04  8:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> Wmisspelled-isr
> Target C C++ Var(avr_warn_misspelled_isr) Init(1)
> Warn if the ISR is misspelled, ...
> 
> should eventually work?

With that, the warnings appear as they should, but the option is not
recognized:

$ avr-gcc signal.c -S -Wmisspelled-isr
error: unrecognized command-line option '-Wmisspelled-isr'

$ avr-gcc signal.c -S -Wno-misspelled-isr
error: unrecognized command-line option '-Wno-misspelled-isr'

$ avr-gcc signal.c -S -Werror=misspelled-isr
error: '-Werror=misspelled-isr': '-Wmisspelled-isr' is not an option that
controls warnings

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

* [Bug other/114191] Flags "Warning" and "Target" don't mix well in target.opt files
  2024-03-01 15:52 [Bug other/114191] New: Flags "Warning" and "Target" don't mix well in target.opt files gjl at gcc dot gnu.org
  2024-03-04  8:14 ` [Bug other/114191] " rguenth at gcc dot gnu.org
  2024-03-04  8:54 ` gjl at gcc dot gnu.org
@ 2024-03-04  9:34 ` gjl at gcc dot gnu.org
  2024-03-04 10:07 ` rguenther at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-03-04  9:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> How did you specify 'Target'?

Like:

Wmisspelled-isr
Target Warning C C++ Var(avr_warn_misspelled_isr) Init(1)
Warn if the ISR is misspelled, ...

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

* [Bug other/114191] Flags "Warning" and "Target" don't mix well in target.opt files
  2024-03-01 15:52 [Bug other/114191] New: Flags "Warning" and "Target" don't mix well in target.opt files gjl at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-03-04  9:34 ` gjl at gcc dot gnu.org
@ 2024-03-04 10:07 ` rguenther at suse dot de
  3 siblings, 0 replies; 5+ messages in thread
From: rguenther at suse dot de @ 2024-03-04 10:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 4 Mar 2024, gjl at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114191
> 
> --- Comment #2 from Georg-Johann Lay <gjl at gcc dot gnu.org> ---
> (In reply to Richard Biener from comment #1)
> > Wmisspelled-isr
> > Target C C++ Var(avr_warn_misspelled_isr) Init(1)
> > Warn if the ISR is misspelled, ...
> > 
> > should eventually work?
> 
> With that, the warnings appear as they should, but the option is not
> recognized:
> 
> $ avr-gcc signal.c -S -Wmisspelled-isr
> error: unrecognized command-line option '-Wmisspelled-isr'
> 
> $ avr-gcc signal.c -S -Wno-misspelled-isr
> error: unrecognized command-line option '-Wno-misspelled-isr'
> 
> $ avr-gcc signal.c -S -Werror=misspelled-isr
> error: '-Werror=misspelled-isr': '-Wmisspelled-isr' is not an option that
> controls warnings

Hmm.  This is how some other targets do it, grepping

grep ^W config/*/*.opt

(a bit noisy because of descriptions).

config/gcn/gcn.opt:Wopenacc-dims
config/gcn/gcn.opt:Warn about invalid OpenACC dimensions.
config/i386/mingw.opt:Wpedantic-ms-format
config/i386/mingw.opt:Warn about none ISO msvcrt scanf/printf width 
extensions.

would be not Target but

config/rs6000/darwin.opt:Waltivec-long-deprecated

uses Target (and thus is dysfunctional)

So it seems we're not set up for 'Target' warnings.

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

end of thread, other threads:[~2024-03-04 10:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-01 15:52 [Bug other/114191] New: Flags "Warning" and "Target" don't mix well in target.opt files gjl at gcc dot gnu.org
2024-03-04  8:14 ` [Bug other/114191] " rguenth at gcc dot gnu.org
2024-03-04  8:54 ` gjl at gcc dot gnu.org
2024-03-04  9:34 ` gjl at gcc dot gnu.org
2024-03-04 10:07 ` rguenther at suse dot de

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).