From: JonY <10walls@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: Re: mingw-w64 and __attribute__((format(printf))) issue
Date: Sun, 10 May 2020 04:27:13 +0000 [thread overview]
Message-ID: <50dad4c6-10cd-ed24-e563-5adc6ad50afc@gmail.com> (raw)
In-Reply-To: <84f2a94f-0d73-fe05-78c6-bd64c1f8ee76@126.com>
[-- Attachment #1.1: Type: text/plain, Size: 1342 bytes --]
On 5/6/20 5:36 AM, Liu Hao via Gcc-help wrote:
> Due to a recent change in mingw-w64 master [1], libgomp ceases to build:
>
> ```
> ../../../gcc-git/libgomp/target.c:936:21: error: unknown conversion type
> character 'l' in format [-Werror=format=]
> 936 | gomp_fatal ("present clause: !acc_is_present (%p, "
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ```
>
>
> On line 29 of 'libgomp/libgomp.h' from GCC 9 branch I found this declaration
>
> ```
> extern void gomp_fatal (const char *, ...)
> __attribute__ ((noreturn, format (printf, 1, 2)));
> ```
>
> , which uses the `printf` attribute, but the `PRIu64` macro from
> <inttypes.h> expands to `%llu` because now GCC has `-std=gnu11` by
> default, which is only valid with `gnu_printf`.
>
> AFAICS there are three solutions:
>
> 1. Revert bfd33f6c0ec5e652cc9911857dd1492ece8d8383 in mingw-w64, or
> 2. Make GCC treat `format(printf)` as `format(gnu_printf)` if C11 or
> C++11 is selected, or
> 3. Replace `format(printf)` with `format(gnu_printf)` in libgomp source.
>
>
> What do you think?
>
>
> [1]
> https://github.com/mingw-w64/mingw-w64/commit/bfd33f6c0ec5e652cc9911857dd1492ece8d8383
>
>
I think option #3 is the simplest approach in the short term, though I
prefer option #2.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-05-10 4:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 5:36 Liu Hao
2020-05-06 10:48 ` [Mingw-w64-public] " Martin Storsjö
2020-05-06 12:45 ` Liu Hao
2020-05-07 4:09 ` Liu Hao
2020-05-10 4:27 ` JonY [this message]
2020-05-10 9:03 ` Liu Hao
2020-05-12 11:14 ` JonY
2020-05-12 12:02 ` Jakub Jelinek
2020-05-12 13:15 ` Liu Hao
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=50dad4c6-10cd-ed24-e563-5adc6ad50afc@gmail.com \
--to=10walls@gmail.com \
--cc=gcc-help@gcc.gnu.org \
/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).