From: Joseph Myers <joseph@codesourcery.com>
To: Harald Anlauf <anlauf@gmx.de>
Cc: Tobias Burnus <tobias@codesourcery.com>,
fortran <fortran@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] PR fortran/50549 - should detect different type parameters in structure constructors
Date: Mon, 28 Mar 2022 21:52:43 +0000 [thread overview]
Message-ID: <alpine.DEB.2.22.394.2203282148210.331358@digraph.polyomino.org.uk> (raw)
In-Reply-To: <b6fb983d-ce50-0b00-8c76-fd4a23c12c01@gmx.de>
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
next prev parent reply other threads:[~2022-03-28 21:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-27 19:44 Harald Anlauf
2022-03-28 10:05 ` Tobias Burnus
2022-03-28 20:03 ` Harald Anlauf
2022-03-28 20:03 ` Harald Anlauf
2022-03-28 21:08 ` Harald Anlauf
2022-03-28 21:08 ` Harald Anlauf
2022-03-28 21:52 ` Joseph Myers [this message]
2022-03-29 7:14 ` Tobias Burnus
2022-03-29 18:48 ` Harald Anlauf
2022-03-29 18:48 ` Harald Anlauf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.2.22.394.2203282148210.331358@digraph.polyomino.org.uk \
--to=joseph@codesourcery.com \
--cc=anlauf@gmx.de \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=tobias@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).