From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 67DCB3858C50; Mon, 28 Mar 2022 21:52:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 67DCB3858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com X-IronPort-AV: E=Sophos;i="5.90,218,1643702400"; d="scan'208";a="73546370" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa3.mentor.iphmx.com with ESMTP; 28 Mar 2022 13:52:49 -0800 IronPort-SDR: WYEON1jNJRGsOgJGofDSxcvDb2uIISYxyckew9xgFwu/QTfkKzUSFavOV3/MSblgyoRRlwsGu2 /kL67eF9+iqPRE9iezkxYvOAxDKrqUOPhX5BpWOzvjalSsiSdX1IAuS5lVTDI1g/J9BNqqRDjZ UpxArz4w4Wn3Bpl4IT5Hr3pW079Uob5h92WUpLa8jr6fDMWHq5Vv0jNhMLMCKWbVfKGYSA04ob lA8y9MXbtZZZV1h/lagrUIH0XHZgUsvzgQnJ5sey7+12ENnYV4javoQ4b2j2iKwrA+Y5z4fvxY KbI= Date: Mon, 28 Mar 2022 21:52:43 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Harald Anlauf CC: Tobias Burnus , fortran , gcc-patches Subject: Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors In-Reply-To: Message-ID: References: <5a7fa9f6-7155-9dc6-d847-e44ccccb447a@codesourcery.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-13.mgc.mentorg.com (139.181.222.13) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3114.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Mar 2022 21:52:53 -0000 On Mon, 28 Mar 2022, Harald Anlauf via Gcc-patches wrote: > Hi Tobias, > > sorry for replying to myself now, but > > Am 28.03.22 um 22:03 schrieb Harald Anlauf via Fortran: > > All current cases of printing a HOST_WIDE_INT in gcc/fortran/ use > > 'sprintf', and I did not find any other use of %wd/%wu.  So the > > mentioned implementation is not really stressed yet... ;-) > > using HOST_WIDE_INT_PRINT_DEC in the format argument to gfc_error > instead of using %wd does not produce a warning and works. > (Also verified with insane character lengths on x86_64). Using string concatenation with a macro is not appropriate in a message argument to a diagnostic function, because it means the full string (which has to be host-independent) doesn't get extracted for translation. HOST_WIDE_INT_PRINT_* are printf formats for the host printf function (for example, they might use %I64d on Windows host), and are not generally understood by the diagnostic.cc machinery at all; functions using the GCC diagnostic machinery need to use GCC diagnostic formats (which are independent of the host printf function), such as %wd/%wu. -- Joseph S. Myers joseph@codesourcery.com