public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: Kai Tietz <ktietz70@googlemail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Henderson <rth@redhat.com>,
	 	Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Subject: Re: [patch]: Add check for stdint header
Date: Fri, 04 Sep 2009 09:57:00 -0000	[thread overview]
Message-ID: <84fc9c000909040257r44566fc7ra3ff886701d57edd@mail.gmail.com> (raw)
In-Reply-To: <90baa01f0909040049k36a03c4s5ae3a65d3d9153d0@mail.gmail.com>

On Fri, Sep 4, 2009 at 9:49 AM, Kai Tietz<ktietz70@googlemail.com> wrote:
> 2009/9/3 Richard Guenther <richard.guenther@gmail.com>:
>> On Thu, Sep 3, 2009 at 1:05 PM, Kai Tietz<ktietz70@googlemail.com> wrote:
>>> 2009/9/3 Richard Guenther <richard.guenther@gmail.com>:
>>>> On Thu, Sep 3, 2009 at 12:18 AM, Kai Tietz<ktietz70@googlemail.com> wrote:
>>>>> 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 header,
>>>> you should probably simply use that.  See 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 <stdint.h>
> #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.

  reply	other threads:[~2009-09-04  9:57 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-02 22:18 Kai Tietz
2009-09-03  1:37 ` Kai Tietz
2009-09-03 10:55 ` Richard Guenther
2009-09-03 11:05   ` Kai Tietz
2009-09-03 11:10     ` Richard Guenther
2009-09-04  7:49       ` Kai Tietz
2009-09-04  9:57         ` Richard Guenther [this message]
2009-09-04 10:36           ` Paolo Bonzini
     [not found]             ` <4AA0EE5E.80204@gnu.org>
     [not found]               ` <90baa01f0909040359r45b5b0c1gfb9132cf800bde9b@mail.gmail.com>
     [not found]                 ` <90baa01f0909040534g4ac57551se2e843b861c42a06@mail.gmail.com>
2009-09-04 13:22                   ` Paolo Bonzini
2009-09-06  9:57           ` Ralf Wildenhues
2009-09-04 12:48 Tobias Burnus
2009-09-04 12:53 ` Kai Tietz
2009-09-04 13:18   ` Tobias Burnus
2009-09-04 13:27     ` Paolo Bonzini
2009-09-04 14:07       ` Kai Tietz
2009-09-05 12:41         ` Paolo Bonzini
2009-09-08 15:22           ` Kai Tietz
2009-09-06 10:00       ` Ralf Wildenhues
2009-09-07  6:51         ` Paolo Bonzini
2009-09-04 13:07 Tobias Burnus
2009-09-04 13:18 ` Kai Tietz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84fc9c000909040257r44566fc7ra3ff886701d57edd@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=Ralf.Wildenhues@gmx.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=ktietz70@googlemail.com \
    --cc=rth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).