public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend
@ 2021-07-09 10:20 mytbk920423 at gmail dot com
  2021-07-09 10:34 ` [Bug ada/101385] " ebotcazou at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: mytbk920423 at gmail dot com @ 2021-07-09 10:20 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101385
           Summary: -Werror doesn't have effect on Ada frontend
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mytbk920423 at gmail dot com
  Target Milestone: ---

I try to make the GCC Ada compiler error when there're warnings, but -Werror
doesn't work.

$ gcc -c -O2 -Werror test.adb && echo "Command returns $?"
test.adb:3:22: warning: value not in range of type "MyChar" defined at line 2
test.adb:3:22: warning: "Constraint_Error" will be raised at run time
Command returns 0

$ gnatmake test.adb -cargs -Werror && echo "Command returns $?"
gcc -c -Werror test.adb
test.adb:3:22: warning: value not in range of type "MyChar" defined at line 2
test.adb:3:22: warning: "Constraint_Error" will be raised at run time
gnatbind -x test.ali
gnatlink test.ali
gnatlink: warning: executable name "test" may conflict with shell command
Command returns 0

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

* [Bug ada/101385] -Werror doesn't have effect on Ada frontend
  2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
@ 2021-07-09 10:34 ` ebotcazou at gcc dot gnu.org
  2021-07-09 11:58 ` mytbk920423 at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-07-09 10:34 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org
   Last reconfirmed|                            |2021-07-09
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
You need to pass -gnatwe instead.

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

* [Bug ada/101385] -Werror doesn't have effect on Ada frontend
  2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
  2021-07-09 10:34 ` [Bug ada/101385] " ebotcazou at gcc dot gnu.org
@ 2021-07-09 11:58 ` mytbk920423 at gmail dot com
  2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mytbk920423 at gmail dot com @ 2021-07-09 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Iru Cai <mytbk920423 at gmail dot com> ---
Thanks, -gnatwe works for both gcc and gnatmake.
I see in the gnat_ugn manual that there is still the -Werror option that causes
GCC back end to treat warnings as errors. Is that means -gnatwe is for front
end, and -Werror for back end?

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

* [Bug ada/101385] -Werror doesn't have effect on Ada frontend
  2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
  2021-07-09 10:34 ` [Bug ada/101385] " ebotcazou at gcc dot gnu.org
  2021-07-09 11:58 ` mytbk920423 at gmail dot com
@ 2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
  2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-07-09 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> I see in the gnat_ugn manual that there is still the -Werror option that
> causes GCC back end to treat warnings as errors. Is that means -gnatwe is
> for front end, and -Werror for back end?

Yes, the -gnatw switches are for the front-end and the -W switches for the
back-end, but we'll make -Werror imply -gnatwe in a future release.

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

* [Bug ada/101385] -Werror doesn't have effect on Ada frontend
  2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
                   ` (2 preceding siblings ...)
  2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
@ 2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
  2021-09-14  8:33 ` cvs-commit at gcc dot gnu.org
  2021-09-14  8:35 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-07-09 15:51 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ebotcazou at gcc dot gnu.org

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

* [Bug ada/101385] -Werror doesn't have effect on Ada frontend
  2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
                   ` (3 preceding siblings ...)
  2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
@ 2021-09-14  8:33 ` cvs-commit at gcc dot gnu.org
  2021-09-14  8:35 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-09-14  8:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Eric Botcazou <ebotcazou@gcc.gnu.org>:

https://gcc.gnu.org/g:f3922acfdfff1e426bd1238cf09eeb84332464c9

commit r12-3513-gf3922acfdfff1e426bd1238cf09eeb84332464c9
Author: Eric Botcazou <ebotcazou@adacore.com>
Date:   Tue Sep 14 10:32:00 2021 +0200

    Implement PR ada/101385

    For consistency's sake with -Wall & -w, this makes -Werror imply -gnatwe.

    gcc/ada/
            PR ada/101385
            * doc/gnat_ugn/building_executable_programs_with_gnat.rst
            (-Wall): Minor fixes.
            (-w): Likewise.
            (-Werror): Document that it also sets -gnatwe by default.
            * gcc-interface/lang-specs.h (ada): Expand -gnatwe if -Werror is
            passed and move expansion of -gnatw switches to before -gnatez.

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

* [Bug ada/101385] -Werror doesn't have effect on Ada frontend
  2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
                   ` (4 preceding siblings ...)
  2021-09-14  8:33 ` cvs-commit at gcc dot gnu.org
@ 2021-09-14  8:35 ` ebotcazou at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2021-09-14  8:35 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
This will work in the 12.x and later series.

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

end of thread, other threads:[~2021-09-14  8:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 10:20 [Bug ada/101385] New: -Werror doesn't have effect on Ada frontend mytbk920423 at gmail dot com
2021-07-09 10:34 ` [Bug ada/101385] " ebotcazou at gcc dot gnu.org
2021-07-09 11:58 ` mytbk920423 at gmail dot com
2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
2021-07-09 15:51 ` ebotcazou at gcc dot gnu.org
2021-09-14  8:33 ` cvs-commit at gcc dot gnu.org
2021-09-14  8:35 ` ebotcazou at gcc dot gnu.org

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