From patchwork Tue May 12 20:42:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1288798 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=adacore-com.20150623.gappssmtp.com header.i=@adacore-com.20150623.gappssmtp.com header.a=rsa-sha256 header.s=20150623 header.b=0zmn0MDf; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49M8rX0y3mz9sSW for ; Wed, 13 May 2020 06:42:49 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 59CAD389682F; Tue, 12 May 2020 20:42:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by sourceware.org (Postfix) with ESMTPS id 5E7003870846 for ; Tue, 12 May 2020 20:42:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5E7003870846 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=botcazou@adacore.com Received: by mail-wr1-x433.google.com with SMTP id j5so17591528wrq.2 for ; Tue, 12 May 2020 13:42:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JFWifIqDrX3nSZ5+UD6dHRdOOCqd52jru2NeF76d23w=; b=0zmn0MDfPoKmJmiQFMtHyf8wNdt9v0HfLqvkfn7+FObwnlE2P+vHvzLFnoDnYuwPn6 +4xAEOIPlbIG7QMkQIXPcaSIIU+1sNUU1qIhlXU3gxDSP6xxXyjGvHq4Xljlz4kWDe10 jEMdLNh7PjPgt4p/zTndSvlu1Y6HkxhChEkYTonKBhGHIWN2w6jNJEkjODc3VBqGaifR qYC9dauzj5nvtd6wJgpiKyuXkRRVnSLPyFITmhAdL1BCOqFByf5DPRSHYeRUpl7pjVBD UvydIHKiLLg8e3IFASbi0Y0fA+Djg22uMB248hVDfrCWX+bpCHEVL5j0n71RnyqjWzeJ 2Efw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=JFWifIqDrX3nSZ5+UD6dHRdOOCqd52jru2NeF76d23w=; b=PuXnpJki6AdUd3eAOKzOHPUfi4/mXhAShft2GyqOh5yLth6JAJKnSTcXgSDro2NK3L lrGDcVekFCYcyFY3k4ayOC2CTLF+8dRhtUhXFM0d4JNDJjIkLMVytkvUI9I9gUvaOoGa /28JuXkLi6XxfmYahXI/uvMIYbBquCtKlB1CzsnkQRtgpnIY42b66reUqdarJ1P9JhXC NZsgyvvcEqYxG3e3l01QTfba5lDoBbfITx5SYn+mkJs3bNtPRSk8kW+Eif3g9i2WRPM3 Q91eHxPM5zbqW9OqgCdB/2ebtsRnuqvHOGmQXQQPTkxcv7WqZvWCWuYefGF6p79Yo+Oo 3QCA== X-Gm-Message-State: AGi0PuZBVB03dJMPIPJmSgxAiQsQHP06MNSfB1uz8c4FWTPCYZnYN50Y I47b40P4ieXTa6ihRzDZTBgZjQShsmUj+g== X-Google-Smtp-Source: APiQypJ1h6LjoAvAdmLCK89EOp2IBTmp4kv4P31MAXHFN8PXKDsKHI7pfXl/SHhUaUUloVYrZvJAbg== X-Received: by 2002:adf:ea09:: with SMTP id q9mr27581079wrm.399.1589316163085; Tue, 12 May 2020 13:42:43 -0700 (PDT) Received: from polaris.localnet ([2a01:e0a:41b:9230:1a03:73ff:fe45:373a]) by smtp.gmail.com with ESMTPSA id v126sm4208395wmb.4.2020.05.12.13.42.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 May 2020 13:42:42 -0700 (PDT) From: Eric Botcazou X-Google-Original-From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [Ada] Suppress warning for Interfaces.C with -fdump-ada-spec Date: Tue, 12 May 2020 22:42:40 +0200 Message-ID: <3300706.se7RloFIm5@polaris> MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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@gcc.gnu.org Sender: "Gcc-patches" The C/C++ bindings generated by means of -fdump-ada-spec always contain with and use clauses for Interfaces.C, but they can be unused in some cases so make sure to avoid warning about that. Tested on x86-64/Linux, applied on the mainline. 2020-05-12 Eric Botcazou c-family/ * c-ada-spec.c (dump_ads): Output pragma Warnings ("U"); on entry. diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c index 6d9192f2a26..c75b173eec3 100644 --- a/gcc/c-family/c-ada-spec.c +++ b/gcc/c-family/c-ada-spec.c @@ -3412,9 +3412,12 @@ dump_ads (const char *source_file, cpp_check = check; dump_ada_nodes (&pp, source_file); - /* We require Ada 2012 syntax, so generate corresponding pragma. - Also, disable style checks since this file is auto-generated. */ - fprintf (f, "pragma Ada_2012;\npragma Style_Checks (Off);\n\n"); + /* We require Ada 2012 syntax, so generate corresponding pragma. */ + fputs ("pragma Ada_2012;\n", f); + + /* Disable style checks and warnings on unused entities since this file + is auto-generated and always has a with clause for Interfaces.C. */ + fputs ("pragma Style_Checks (Off);\npragma Warnings (\"U\");\n\n", f); /* Dump withs. */ dump_ada_withs (f);