Question about format.c check for __GNUC_MINOR__ of 6
Mike Fulton <[email protected]> Wed, 6 Sep 2023 15:08:33 -0700
| Newsgroups | gmane.comp.gnu.m4.bugs |
|---|---|
| Message-ID | <CAOmchhHsUbvKiVm1BTvGPqzJSqgRKwf1vsWF9Z53LfKzL5cBpw@mail.gmail.com> |
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