Compiler warnings in libgpg-error 1.33 on macOS
Closed, ResolvedPublic

Description

I just downloaded and built libgpg-error 1.33 on macOS 10.13.6 (High Sierra). It built successfully, but I see a bunch of compiler warnings that I don't recall seeing before. They all look like this (but the "file included from" changes):

In file included from posix-lock.c:42:
./gpgrt-int.h:467:9: warning: 'snprintf' macro redefined [-Wmacro-redefined]
#define snprintf _gpgrt_estream_snprintf
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:56:9: note:
      previous definition is here
#define snprintf(str, len, ...) \
        ^
1 warning generated.
chdiza created this task.Dec 7 2018, 8:22 PM
chdiza created this object in space S1 Public.
werner added a subscriber: werner.Dec 7 2018, 8:58 PM

Well, -Wno-macro-redefined should silence the warning but Iwill add an undef before our macro definition. The snprintf macro is used to make sure the libgpg-error's own printf implementation is used.

werner closed this task as Resolved.Dec 7 2018, 9:00 PM
werner claimed this task.

Thanks for the report.