From: Florian Weimer Date: Mon, 4 Sep 2017 08:52:28 +0000 (+0200) Subject: math.h: Warn about an already-defined log macro X-Git-Tag: glibc-2.27~969 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b38042f51430974642616a60afbbf96fd0b98659;p=thirdparty%2Fglibc.git math.h: Warn about an already-defined log macro This is a common programming error, and the cause of the problem is not always obvious. defines a log macro, but it includes before that, so that is compatible with the warning. --- diff --git a/ChangeLog b/ChangeLog index ef4a6edc5ea..a9fb242bf26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-09-04 Florian Weimer + + * math/math.h: Issue warning if log is defined. + 2017-09-04 Joseph Myers * scripts/build-many-glibcs.py (Context.checkout): Default Linux diff --git a/math/math.h b/math/math.h index 547b36d10ed..6c2ad97fb8e 100644 --- a/math/math.h +++ b/math/math.h @@ -26,6 +26,11 @@ #define __GLIBC_INTERNAL_STARTING_HEADER_IMPLEMENTATION #include +#if defined log && defined __GNUC__ +# warning A macro called log was already defined when was included. +# warning This will cause compilation problems. +#endif + __BEGIN_DECLS /* Get definitions of __intmax_t and __uintmax_t. */