bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question about format.c check for __GNUC_MINOR__ of 6


From: Mike Fulton
Subject: Question about format.c check for __GNUC_MINOR__ of 6
Date: Wed, 6 Sep 2023 15:08:33 -0700

Hello,

The m4 dev line ( git://git.savannah.gnu.org/m4.git )
has the following code:

```
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
```

This produces an error on the clang compiler I am using on z/OS, which is at 4.2 with the xasprintf code that follows, e.g.

```
str = xasprintf (fstart, width, ARG_INT(argc, argv));
```

If I change the check to:

```
#if 4 < __GNUC__ + (2 <= __GNUC_MINOR__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
```

all is good - it compiles clean. The question is whether the check for 6 is too high or if the clang compiler on z/OS has a bug (or something else)?

I haven't been able to determine what level of gcc provides this diagnostic.

thanks, mike

reply via email to

[Prev in Thread] Current Thread [Next in Thread]