From patchwork Mon Apr 28 21:27:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 740 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx22.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 37B0F360072 for ; Mon, 28 Apr 2014 14:27:38 -0700 (PDT) Received: by homiemail-mx22.g.dreamhost.com (Postfix, from userid 14307373) id DADBA50F0356; Mon, 28 Apr 2014 14:27:37 -0700 (PDT) X-Original-To: glibc@patchwork.siddhesh.in Delivered-To: x14307373@homiemail-mx22.g.dreamhost.com 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 homiemail-mx22.g.dreamhost.com (Postfix) with ESMTPS id B1AEC50F036D for ; Mon, 28 Apr 2014 14:27:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=dTk+U cx9ZFK2yyHL5Ups699jf+aSJuJmXHOANoNVEbwbaKkB0XQq/bTBL7JKHHoIeutMZ 6Bk7QQt+RLhfdnlZpjKZ2OxFKli8+BABBY8In6+D6gbBHiLDbhP45QGbcUpqHj4W +/piexTtNyqXg5unOy7a4/ocVVmXqRvwJhiYaM= 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:from:date:to:subject:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=b4bfY1aF0yO hTxrL+rWHFeogwj8=; b=EaJaigUrFkAPTHXlMqwJ27RqhsirhVD6vOgmK5tLk3A Yf2x7FBA1CSxhEq6pIWq83JjlqOFFh88UyoRs2m8wt10qva2L8LIa+FAuM2Nqnxa EFUlYrxf7fJos6FpMCbwAElBe7dS8yUv2sBx/ydRGNld0pLNqTIyBt/AmPVNTMKo = Received: (qmail 17259 invoked by alias); 28 Apr 2014 21:27:35 -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 17248 invoked by uid 89); 28 Apr 2014 21:27:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com From: "Steve Ellcey " Date: Mon, 28 Apr 2014 14:27:26 -0700 To: Subject: [Patch] Fix PRI_MACROS_BROKEN undef warnings. User-Agent: Heirloom mailx 12.5 6/20/10 MIME-Version: 1.0 Message-ID: X-DH-Original-To: glibc@patchwork.siddhesh.in Here is another undefined macro warning fix. PRI_MACROS_BROKEN is only used in loadmsgcat.c in the intl directory. It is never set anywhere in glibc sources but binutils and gcc use a intl directory that I believe is derived from the glibc one. The configure scripts of these products set PRI_MACROS_BROKEN, but the intl sources in them don't appear to have been updated from glibc since 2003. So, if we care about keeping something that is usable with GCC/binutils this patch seems like the best fix but if we don't care about staying in sync with the intl directory of GCC or binutils we could just remove PRI_MACROS_BROKEN completely or even remove the entire section of code that sets the various PRI* macros since we know that glibc itself has the correct definitions. The m4 macro that binutils and GCC use to set PRI_MACROS_BROKEN mentions AIX 4.3.3 as a platform where the macros are defined as non-string values. There are already a number differences between intl in glibc and the one in GCC and binutils. Tested on mips-mti-linux-gnu with no difference in the object files generated. Steve Ellcey sellcey@mips.com 2014-04-28 Steve Ellcey * intl/intl/loadmsgcat.c (PRI_MACROS_BROKEN): Set default value if not set. diff --git a/intl/loadmsgcat.c b/intl/loadmsgcat.c index b96a997..e6483ce 100644 --- a/intl/loadmsgcat.c +++ b/intl/loadmsgcat.c @@ -94,6 +94,11 @@ char *alloca (); /* Provide fallback values for macros that ought to be defined in . Note that our fallback values need not be literal strings, because we don't use them with preprocessor string concatenation. */ + +#ifndef PRI_MACROS_BROKEN +#define PRI_MACROS_BROKEN 0 +#endif + #if !defined PRId8 || PRI_MACROS_BROKEN # undef PRId8 # define PRId8 "d"