From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4200 invoked by alias); 4 Sep 2009 09:57:33 -0000 Received: (qmail 4188 invoked by uid 22791); 4 Sep 2009 09:57:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mail-vw0-f174.google.com (HELO mail-vw0-f174.google.com) (209.85.212.174) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Sep 2009 09:57:26 +0000 Received: by vws4 with SMTP id 4so579446vws.0 for ; Fri, 04 Sep 2009 02:57:24 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.42.80 with SMTP id r16mr15109872vce.52.1252058244001; Fri, 04 Sep 2009 02:57:24 -0700 (PDT) In-Reply-To: <90baa01f0909040049k36a03c4s5ae3a65d3d9153d0@mail.gmail.com> References: <90baa01f0909021518w469a8991ga54bacf8f7df68f9@mail.gmail.com> <84fc9c000909030355r6843e245j5f5290b021d4ec0e@mail.gmail.com> <90baa01f0909030405q77ba38b0ibb0eebc8c3b560a4@mail.gmail.com> <84fc9c000909030409u2fc11f7fs5c9d4fe60dd7c6a1@mail.gmail.com> <90baa01f0909040049k36a03c4s5ae3a65d3d9153d0@mail.gmail.com> Date: Fri, 04 Sep 2009 09:57:00 -0000 Message-ID: <84fc9c000909040257r44566fc7ra3ff886701d57edd@mail.gmail.com> Subject: Re: [patch]: Add check for stdint header From: Richard Guenther To: Kai Tietz Cc: GCC Patches , Richard Henderson , Ralf Wildenhues Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00346.txt.bz2 On Fri, Sep 4, 2009 at 9:49 AM, Kai Tietz wrote: > 2009/9/3 Richard Guenther : >> On Thu, Sep 3, 2009 at 1:05 PM, Kai Tietz wrote: >>> 2009/9/3 Richard Guenther : >>>> On Thu, Sep 3, 2009 at 12:18 AM, Kai Tietz wr= ote: >>>>> Hello, >>>>> >>>>> this patch adds to gcc's system.h file the include of stdint.h file, >>>>> if present. If it doesn't finds this header it defines uintptr_t as >>>>> 'unsigned long' and intptr_t as 'long'. >>>> >>>> The toplevel already has support for creating a stdint comaptible head= er, >>>> you should probably simply use that. =A0See config/stdint*.m4. >>>> >>>> Richard. >>> >>> Well, we could extend this, but autoconf 2.64 supports the >>> AC_TYPE_UINTPTR_T and AC_TYPE_INTPTR_T, and defines the types >>> uintptr_t & intptr_t (as macros) for hosts without stdint.h fine. >> >> I'd say use the exisitng support - it's already heavily used by target >> libs which >> just do >> >> GCC_HEADER_STDINT(gstdint.h) >> >> and then include gstdint.h instead of stdint.h. >> >> The question is of course if it works well enough for the host, but >> you'll find out. >> >> Richard. > > Well, I tested things about it. There are two issues I found about the > use of gstdint.h instead of using 2.64 UINTPTR_T and INPTR_T checks. > First the gstdint.h needs to generated dependent and added to the > include CFLAGS options, well this isn't hard. But by using it in > system.h header all function decl checks seems to fail. I tested the > other variant by using > #ifdef HAVE_STDINT_H > #include > #endif > in system.h and it bootstraps on linux without issues. > > So I would like to use the previous patch without gstdint.h header for > solving this issue. I suppose the explicit check for stdint.h is not necessary and you need to cover for the case where inttypes.h provides the required definition. See the autoconf manual which says -- Macro: AC_TYPE_INTPTR_T If `stdint.h' or `inttypes.h' defines the type `intptr_t', define `HAVE_INTPTR_T'. Otherwise, define `intptr_t' to a signed integer type wide enough to hold a pointer, if such a type exists. I don't know what the canonical header inclusion case to use would be though. Maybe Ralf knows. Richard.