From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1285) id C1C803858402; Tue, 14 Sep 2021 08:33:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C1C803858402 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Eric Botcazou To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-3513] Implement PR ada/101385 X-Act-Checkin: gcc X-Git-Author: Eric Botcazou X-Git-Refname: refs/heads/master X-Git-Oldrev: 45d32da2bc0f62f196ec311dddb89563555b1a2a X-Git-Newrev: f3922acfdfff1e426bd1238cf09eeb84332464c9 Message-Id: <20210914083322.C1C803858402@sourceware.org> Date: Tue, 14 Sep 2021 08:33:22 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 08:33:22 -0000 https://gcc.gnu.org/g:f3922acfdfff1e426bd1238cf09eeb84332464c9 commit r12-3513-gf3922acfdfff1e426bd1238cf09eeb84332464c9 Author: Eric Botcazou 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. Diff: --- .../doc/gnat_ugn/building_executable_programs_with_gnat.rst | 11 +++++++---- gcc/ada/gcc-interface/lang-specs.h | 7 ++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst index 07c38df6fa0..5a69967615f 100644 --- a/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst +++ b/gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst @@ -4157,16 +4157,16 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch enables most warnings from the GCC back end. The code generator detects a number of warning situations that are missed by the GNAT front end, and this switch can be used to activate them. - The use of this switch also sets the default front end warning mode to - :switch:`-gnatwa`, that is, most front end warnings activated as well. + The use of this switch also sets the default front-end warning mode to + :switch:`-gnatwa`, that is, most front-end warnings are activated as well. .. index:: -w (gcc) :switch:`-w` Conversely, this switch suppresses warnings from the GCC back end. - The use of this switch also sets the default front end warning mode to - :switch:`-gnatws`, that is, front end warnings suppressed as well. + The use of this switch also sets the default front-end warning mode to + :switch:`-gnatws`, that is, front-end warnings are suppressed as well. .. index:: -Werror (gcc) @@ -4175,6 +4175,9 @@ of the pragma in the :title:`GNAT_Reference_manual`). This switch causes warnings from the GCC back end to be treated as errors. The warning string still appears, but the warning messages are counted as errors, and prevent the generation of an object file. + The use of this switch also sets the default front-end warning mode to + :switch:`-gnatwe`, that is, front-end warning messages and style check + messages are treated as errors as well. A string of warning parameters can be used in the same parameter. For example:: diff --git a/gcc/ada/gcc-interface/lang-specs.h b/gcc/ada/gcc-interface/lang-specs.h index f5a7496ad5d..d26cc8d0534 100644 --- a/gcc/ada/gcc-interface/lang-specs.h +++ b/gcc/ada/gcc-interface/lang-specs.h @@ -36,7 +36,7 @@ "\ %{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{!S:%{!c:%e-c or -S required for Ada}}\ - gnat1 %{I*} %{k8:-gnatk8} %{Wall:-gnatwa} %{w:-gnatws} %{!Q:-quiet}\ + gnat1 %{I*} %{k8:-gnatk8} %{!Q:-quiet}\ %{nostdinc*} %{nostdlib*}\ %{fcompare-debug-second:-gnatd_A} \ %{O*} %{W*} %{w} %{p} %{pg:-p} " ADA_DUMPS_OPTIONS " \ @@ -44,8 +44,9 @@ #if defined(TARGET_VXWORKS_RTP) "%{fRTS=rtp|fRTS=rtp-smp|fRTS=ravenscar-cert-rtp:-mrtp} " #endif - "%{gnatea:-gnatez} %{g*&m*&f*} " - "%1 %{!S:%{o*:%w%*-gnatO}} \ + "%{Wall:-gnatwa} %{Werror:-gnatwe} %{w:-gnatws} \ + %{gnatea:-gnatez} %{g*&m*&f*} \ + %1 %{!S:%{o*:%w%*-gnatO}} \ %i %{S:%W{o*}%{!o*:-o %w%b.s}} \ %{gnatc*|gnats*: -o %j} %{-param*} \ %{!gnatc*:%{!gnats*:%(invoke_as)}}", 0, 0, 0},