From patchwork Mon Sep 4 09:09:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 809575 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-84157-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="suSzkIE9"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xm3w90tXGz9s72 for ; Mon, 4 Sep 2017 19:10:16 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; q=dns; s=default; b= nc5NDBkReHyOD59VcvMtiho8Qwb7Li73HUCxfSvPA5d8JbGOiTg9V5vL11uSxcKS Js8Cz9ysVWe3HvhdhCVFyDz9V8WPAAGqQzrVG5P8C520aOWTR/mh1SRpBsOpyV8w wpOtrv8PvfVgb9Woy5znKtmI9hKFFKF8IYfRwaLaZXs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id:from; s=default; bh=nE75Ta d+JTt+doER2oWyhU0bMe0=; b=suSzkIE9QCQND6UtARvnanrtyfHJP6MdrQTPt/ +o9Qe1hyuQ32wsJigtgH4R3OYZjqSB+H1W6BqBGgM/c/Vmiwin0ekcg3GOX04bvX wrcJB0w+NOVbviuRfoN0Nvn26IGruGaUgQi/GPQixwpI9FilZljOsOor9TQKgBD0 ME6Mk= 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-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@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 11:09:59 +0200 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 Message-Id: <20170904090959.276DE439942E3@oldenburg.str.redhat.com> From: fweimer@redhat.com (Florian Weimer) 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. */