From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3574 invoked by alias); 4 Sep 2017 09:10:11 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 3564 invoked by uid 89); 4 Sep 2017 09:10:11 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:821 X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 5A46E821C3 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Date: Mon, 04 Sep 2017 09:10:00 -0000 To: libc-alpha@sourceware.org Subject: [PATCH] math.h: Warn about an already-defined log macro User-Agent: Heirloom mailx 12.5 7/5/10 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20170904090959.276DE439942E3@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) X-SW-Source: 2017-09/txt/msg00155.txt.bz2 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. 2017-09-04 Florian Weimer * math/math.h: Issue warning if log is defined. diff --git a/math/math.h b/math/math.h index 547b36d10e..6c2ad97fb8 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. */