Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 398495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T16:45:14+00:00 2026-05-12T16:45:14+00:00

Is there a reliable way to declare typedefs for integer types of fixed 8,16,32,

  • 0

Is there a reliable way to declare typedefs for integer types of fixed 8,16,32, and 64 bit length in ISO Standard C?

When I say ISO Standard C, I mean that strictly:

  • ISO C89/C90, not C99.
  • No headers not defined in the ISO standard.
  • No preprocessor symbols not defined in the ISO standard.
  • No type-size assumptions not specified in the ISO standard.
  • No proprietary vendor symbols.

I see other questions similar to this in StackOverflow, but no answers yet that do not violate one of the above constraints. I’m not sure it’s possible without resorting to platform symbols.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T16:45:15+00:00Added an answer on May 12, 2026 at 4:45 pm

    Yes you can.

    The header file limits.h should be part of C90. Then I would test through preprocessor directives values of SHRT_MAX, INT_MAX, LONG_MAX, and LLONG_MAX and set typedefs accordingly.

    Example:

    #include <limits.h>
    
    #if SHRT_MAX == 2147483647
    typedef unsigned short int uint32_t;
    #elif INT_MAX == 2147483647
    typedef unsigned int uint32_t;
    #elif LONG_MAX == 2147483647
    typedef unsigned long uint32_t ;
    #elif LLONG_MAX == 2147483647
    typedef unsigned long long uint32_t;
    #else
    #error "Cannot find 32bit integer."
    #endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a reliable way of detecting what version of Java is installed on
I'm trying to find if there is a reliable way (using SQLite ) to
Is there a reliable way of preventing my actionscript code (as2 or as3) from
Is there a reliable way, using PHP, to determine if a request comes from
Is there a reliable way of round tripping a HTTP cookie value exactly once?
This may be a bit of a weird question, but is there any reliable
Is there a reliable crossbrowser way to open up a shell using javascript (e.g.
Is there any reliable way to convert CVSNT to SVN?
Is there a reliable way to create a custom view for a Zend_Form ?
Is there a pure .net way to do this reliably? The solutions I keep

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.