From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14129 invoked by alias); 27 Jun 2008 19:13:38 -0000 Received: (qmail 14113 invoked by uid 22791); 27 Jun 2008 19:13:37 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 27 Jun 2008 19:13:17 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 46FB898366; Fri, 27 Jun 2008 19:13:15 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 238C998337; Fri, 27 Jun 2008 19:13:15 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KCJNi-0005AM-7S; Fri, 27 Jun 2008 15:13:14 -0400 Date: Fri, 27 Jun 2008 19:37:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org, bug-gnulib@gnu.org Subject: Re: [RFC] Use gnulib's stdint.h. Message-ID: <20080627191314.GA19538@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org, bug-gnulib@gnu.org References: <20080605184041.GA25085@caradoc.them.org> <20080626155155.GA27012@caradoc.them.org> <20080627185907.GA11664@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080627185907.GA11664@adacore.com> User-Agent: Mutt/1.5.17 (2008-05-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-06/txt/msg00516.txt.bz2 On Fri, Jun 27, 2008 at 02:59:07PM -0400, Joel Brobecker wrote: > There are two distinct issues that I have seen so far: > > 1. dfp.c includes libdecnumber/dpd/decimal128.h which ends up > including gstdint.h. But before we included decimal128.h, we > had already included defs.h which includes gnulib/stdint.h. > The two files end up colliding. > > For instance, gstdint.h contains: > typedef int16_t int_least16_t; > > But gnulib/stdint.h also contains: > #define int16_t short int > #define int_least16_t int16_t > > So we end up with the above being rewritten to: > typedef short int short int; Boo. And if we change libdecnumber to use gnulib's version we'll undoubtedly break gcc. If we provide gstdint.h in the gdb directory which redirects to , will libdecnumber pick it up at this point? That relies on the types being in-practice compatible which will be the case, rather than making the two headers compatible. > 2. ctype/safe-ctype conflict. For instance, cp-support.c includes > safe-ctype.h. But at the same time, we previously included > defs.h, which itself includes gnulib/stdint.h, which includes > which includes . > Problem #2 is a lot more problematic, however. I might argue that > this is a actually bug inside gnulib and that gnulib/stdint.h > should be generated in a way that avoids including other standard > header files. Although this might be the case for the current > stdint.h files that exist, I don't think there is an explicit > rule against it. Even if not categorized as a bug, perhaps it > would be a worthwhile enhancement, as the documented reason for > including this file is to get a couple of macros: > > #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS > > /* Get WCHAR_MIN, WCHAR_MAX. */ > # if ! (defined WCHAR_MIN && defined WCHAR_MAX) > # include > # endif > > #endif > > Perhaps we could somehow generate the macro definitions ourselves, > which would help avoiding the include. Ideally, gnulib would take > care of that and avoid the include, or we could compute the WCHAR_MIN > and WCHAR_MAX during the GDB configury and define the macros just > before including gnulib/stdint.h. I agree that having gnulib pull in wchar.h is very unfortunate. The gnulib folks, CC'd, are very responsive - maybe someone on bug-gnulib has an idea on how to fix this? -- Daniel Jacobowitz CodeSourcery