Minor tweak needed for MacOS 15.2

David Arnstein <[email protected]> Sat, 14 Dec 2024 23:44:37 -0800
Newsgroups gmane.comp.gnu.m4.bugs
Message-ID <[email protected]>
Hello,

I would like to suggest a small bugfix for compilation under MacOS 15.2.

I built m4 from source code from git://git.sv.gnu.org/m4. I checked out 
git tag v1.4.19.

My build environment is Xcode as provided by Apple. The compiler is as 
follows:
imac3 796> clang
clang    clang++  clangd
imac3 796> clang --version
Apple clang version 16.0.0 (clang-1600.0.26.6)
Target: x86_64-apple-darwin24.2.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

To get a successful build, I needed to add one line of code to source 
file src/format.c:


#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__) /* Line 353 of src/format.c */
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
/* I added the following line of code: */
# pragma GCC diagnostic ignored "-Wformat-nonliteral"

Apparently, the test
#if 4 < __GNUC__ + (6 <= __GNUC_MINOR__)
is not adequate for Apple's compiler environment.

-- 
David Arnstein
[email protected]