Re: Pedants, please help on integer types

Discussion in 'C Programming' started by rudolf, Aug 5, 2012.

  1. rudolf

    rudolf Guest

    In article <>,
    Aaron W. Hsu <> wrote:

    > I am hoping that the pedants from CLC can help! Basically, I am in a
    > discussion elsewhere with someone who is claiming that C90 provides for
    > no explicit means of getting an integer of *any* width at all. That is,
    > that all integer types could be any size they want. I was always under
    > the impression that the following where guarantees:
    >
    > char at least 8 bits
    > short at least 16 bits
    > long at least 32 bits
    > int at least 16 bits
    >
    > Is this not the case?


    I think you are correct.

    Here's a text copy of a draft of C90:
    http://flash-gordon.me.uk/ansi.c.txt

    Look at section 2.2.4.2 (numerical limits)


    >
    > Also, another claim is that GCC in -pedantic mode does not allow bitfields
    > on uint64_t types. Is this an actual restricton of C99 (not C90)? That is,
    > can you only use, what are they called, natural types like long long?
    > If that is the case, then does that mean that you cannot get a guaranteed
    > width size for a structure using bit fields?
    >
    > I would appreciate some authoratative advice, as I do not have a copy
    > of C90 or C99; relevant quotes from the standards would be great. I do
    > not know whether I am misremembering things or if I am correct.


    Not sure about that one. This page has links to the standard and its
    drafts.
    http://clc-wiki.net/wiki/The_C_Standard
     
    rudolf, Aug 5, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KK
    Replies:
    2
    Views:
    596
    Big Brian
    Oct 14, 2003
  2. Replies:
    163
    Views:
    3,264
  3. jacob navia

    bunch of pedants

    jacob navia, Mar 16, 2008, in forum: C Programming
    Replies:
    65
    Views:
    1,420
    David Thompson
    Mar 31, 2008
  4. jacob navia

    Pedants

    jacob navia, Jun 21, 2008, in forum: C Programming
    Replies:
    121
    Views:
    3,054
    Richard Bos
    Jul 3, 2008
  5. Keith Thompson

    Re: Pedants, please help on integer types

    Keith Thompson, Aug 5, 2012, in forum: C Programming
    Replies:
    1
    Views:
    434
    Keith Thompson
    Aug 5, 2012
Loading...

Share This Page