public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <jsm@polyomino.org.uk>
To: Jason Catena <jason@jcatena.net>
Cc: gcc@gcc.gnu.org
Subject: Re: I would like to help implement stdint.h
Date: Sat, 11 Oct 2003 18:17:00 -0000	[thread overview]
Message-ID: <Pine.LNX.4.58.0310111102450.20935@kern.srcf.societies.cam.ac.uk> (raw)
In-Reply-To: <200310110135.h9B1Z1bX023643@jcatena.net>

On Fri, 10 Oct 2003, Jason Catena wrote:

> Since stdint.h is platform-dependent, I was thinking of writing a
> small program that would translate a description of the type sizes on
> the target to a finished stdint.h file. Alternately, I could create a
> library of stdint.h files, but it seems more efficient and flexible to
> create it in the fly.

The current thinking is that you should follow the same approach now used
for <limits.h> and <float.h> - that is, have a single stdint.h file that
uses macros predefined by the compiler to determine the types involved.  
Because many targets can have their type sizes changed at compiler runtime
with -m options, generating a <stdint.h> file at compiler build time isn't
a feasible approach.

There will need to be sensible defaults for the types, as well as target
macros to override them.  A fair amount of work will be involved in going
through supported targets which have their own <stdint.h>, such as all
glibc-based targets, to ensure that GCC's types agree with those systems'
types.  This is also necessary on systems which have <inttypes.h> but not
<stdint.h> (such as Solaris).  Note that GCC will also need to gain an
awareness of sig_atomic_t, which it previously hasn't needed to know about
(and some embedded targets may not have at all; see DR#248).

<stdint.h> may also need to be compatible with what various systems' other
headers expect of it or of <inttypes.h> (try to make something more
comprehensible than GCC's <stddef.h>).

Some fixincludes work may also be needed to make existing system headers
work well with GCC's <stdint.h>, especially on systems which have
<inttypes.h> only.

-- 
Joseph S. Myers
jsm@polyomino.org.uk

      reply	other threads:[~2003-10-11 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-11  4:56 Jason Catena
2003-10-11 18:17 ` Joseph S. Myers [this message]

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=Pine.LNX.4.58.0310111102450.20935@kern.srcf.societies.cam.ac.uk \
    --to=jsm@polyomino.org.uk \
    --cc=gcc@gcc.gnu.org \
    --cc=jason@jcatena.net \
    /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).