From patchwork Tue Sep 14 08:33:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 44978 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F33C385843B for ; Tue, 14 Sep 2021 08:34:18 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by sourceware.org (Postfix) with ESMTPS id E68C13858402 for ; Tue, 14 Sep 2021 08:34:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E68C13858402 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-wr1-x42e.google.com with SMTP id q11so18823060wrr.9 for ; Tue, 14 Sep 2021 01:34:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JVLLQjzwvQLWRqq32F4TRgonj/qPOv/vXpof/fuSdiU=; b=fpDVJLV22gJ0g6ytEssgcC5whQ4OtX+c/nRcQVXB8RgxmH464GIkB0dqyA1w8svMzi K6+vyXp4zsrF6jCV8A7lWovXIlSpjJIpE3BYcPM5w9O+Gt9FD5ApxO9OChCOt++tYSTo QqalHuADIVvt3+3ZqNq3YdKTFpBe57oss+PRwTBsrLBVlpv2xV3fqZIWEmdQWsM/pl5O fueUoJxoIvE+SDHAz5/UqTSC9UKJzJMWELBSemL4L/pSOH5mNVyTrN7iIsNeeB2FWWVX ukQC40+lGtL0GYBvW0Drj8+AIxY7OENCGuwxoe9OKHM4nM/jRPqXHWc60lRgm7CBCYK8 acVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JVLLQjzwvQLWRqq32F4TRgonj/qPOv/vXpof/fuSdiU=; b=C+3NrOg0rBvn/pUcyQkKpLoxhO0NzcKgPwqzg5h3Yh5PieV91v/xIgWQWf/KdwHlx9 f/RLzgu5ypQOTTPdn6oQYMTG6mS8OiGYC6xmmMz9tLNzwVqVV+ioimDrNsk/BvXOPEPl qWXJpjskUqzt7+yFZ8pxvnVxM90j4Mf0XeRpcCtP8bz+IiBFPrx9n19fi0e/CyngWwN6 RNE5j8E0SWgcJOIc68wFzVPyJ+WedzYu3OCLfb6u0882AWbt4B8LxouuER0vddNWt+Ph YDSxeG6Uh53oPK9HLlG89hc/pUBelg78FD5APKg5pixBN53RZg1svjvbFqnae01MCNU5 e1Ow== X-Gm-Message-State: AOAM532y6R/3TSJczrf/BKDA/SKxf6GRRohvuxVmYYIIaaaXgaznXUIk ZuYeAZkkcjzdc5aNCKIIHJbjsIeXbIL3Z5sA X-Google-Smtp-Source: ABdhPJxprG/oUqgk5riPkaf5WAQm4XeRRKwaYSeCh8hSAloA/FObnQ+94k3TyRmqO0SqA7yPZ6lb9A== X-Received: by 2002:a5d:6381:: with SMTP id p1mr17614898wru.310.1631608439841; Tue, 14 Sep 2021 01:33:59 -0700 (PDT) Received: from fomalhaut.localnet ([2a01:e0a:41b:84f0:cf71:f5e0:b050:bede]) by smtp.gmail.com with ESMTPSA id o17sm9673339wrj.96.2021.09.14.01.33.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Sep 2021 01:33:58 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Implement PR ada/101385 Date: Tue, 14 Sep 2021 10:33:48 +0200 Message-ID: <3135000.44csPzL39Z@fomalhaut> MIME-Version: 1.0 X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" For the sake of consistency with -Wall & -w, this makes -Werror imply -gnatwe. Tested on x86-64/Linux, applied on the mainline. 2021-09-14 Eric Botcazou 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 --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},