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 7006543
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:29:28+00:00 2026-05-27T21:29:28+00:00

How would compilers implementing the freestanding portion of each different standard below have to

  • 0

How would compilers implementing the freestanding portion of each different standard below have to differ? What would be the fewest number of modes (specified by command line flags, for example) required to support all of them?

  1. ISO/IEC 9899:1990
  2. ISO/IEC 9899:1990 + ISO/IEC 9899 TCOR1
  3. ISO/IEC 9899:1990 + ISO/IEC 9899 TCOR1 + ISO/IEC 9899 AM1
  4. ISO/IEC 9899:1990 + ISO/IEC 9899 TCOR1 + ISO/IEC 9899 AM1 + ISO/IEC 9899 TCOR2
  5. ISO/IEC 9899:1999
  6. ISO/IEC 9899:1999 + ISO/IEC 9899:1999 Cor. 1:2001(E)
  7. ISO/IEC 9899:1999 + ISO/IEC 9899:1999 Cor. 1:2001(E) + ISO/IEC 9899:1999 Cor. 2:2004(E)
  8. ISO/IEC 9899:1999 + ISO/IEC 9899:1999 Cor. 1:2001(E) + ISO/IEC 9899:1999 Cor. 2:2004(E) + ISO/IEC 9899:1999 Cor. 3:2007(E)
  9. ISO/IEC 9899:2011
  • 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-27T21:29:29+00:00Added an answer on May 27, 2026 at 9:29 pm

    The TCs (technical corrigenda or technical corrections) should be treated as part of the corresponding base standard. So, you really have 4 possible standards to deal with:

    1. ISO/IEC 9899:1990 plus TCs.
    2. ISO/IEC 9899:1990 + AM1 (effectively 9899:1995) plus TCs.
    3. ISO/IEC 9899:1999 plus TCs.
    4. ISO/IEC 9899:2011

    The Amendment 1 for C90 added new headers and functions for wide character and multi-byte character sets, so it contained truly new standard material. The technical corrigenda fix issues in the standard wording, clarifying what needs to be clarified, and correcting technical errors in the document.

    So, I would suggest that those four modes would be sufficient:

    • -std=c90
    • -std=c95
    • -std=c99
    • -std=c11

    Or, if we are going to pay attention to the mistakes that led to the Y2K problems, then:

    • -std=c1990
    • -std=c1995
    • -std=c1999
    • -std=c2011

    (One advantage of this is that the newest standard has the highest number once more!)


    For freestanding implementations, there are few differences in the four headers that are required:

    • <stddef.h>
    • <limits.h>
    • <float.h>
    • <stdarg.h>

    There was an extra macro/function, va_copy(), added to <stdarg.h> in C99.

    Correction

    I just checked the relevant parts of C99, and there are a number of extra headers required for a freestanding implementation in C99:

    §4 Conformance

    ¶6 The two forms of conforming implementation are hosted and freestanding. A conforming
    hosted implementation shall accept any strictly conforming program. A conforming
    freestanding implementation shall accept any strictly conforming program that does not
    use complex types and in which the use of the features specified in the library clause
    (clause 7) is confined to the contents of the standard headers <float.h>,
    <iso646.h>, <limits.h>, <stdarg.h>, <stdbool.h>, <stddef.h>, and
    <stdint.h>. A conforming implementation may have extensions (including additional
    library functions), provided they do not alter the behavior of any strictly conforming
    program.3)

    3) This implies that a conforming implementation reserves no identifiers other than those explicitly
    reserved in this International Standard.

    §5.1.2.1 Freestanding environment

    ¶1 In a freestanding environment (in which C program execution may take place without any
    benefit of an operating system), the name and type of the function called at program
    startup are implementation-defined. Any library facilities available to a freestanding
    program, other than the minimal set required by clause 4, are implementation-defined.

    ¶2 The effect of program termination in a freestanding environment is implementation defined.


    Otherwise, the main changes occurred in the core language in C99 – things like the new types (long long), new initialization notations, and VLAs, and so on. From this perspective, AM1 (C95) didn’t change anything for a freestanding implementation (unless digraphs were added then) because the main changes were in new headers that are not required in a freestanding implementation.

    Hosted implementations face many more issues because the library support was fairly extensively modified between C90 and C99.


    Did any of the changes for freestanding implementations break backwards compatability? In other words, if I have a strictly freestanding C{1990,1995,1999} conforming program, will it necessarily compile and work as expected on a conforming C11 implementation?

    I’m not aware of any backwards compatibility issues for freestanding as opposed to hosted implementations. With C99, the ‘implicit int‘ rules are officially gone – you should declare functions before using them and the return type should be explicitly int (so, for example, a simple main() is no longer officially valid; you should write int main() or, better, int main(void) or similar). But these are general changes between C90 (C95) and C99 – not peculiar to freestanding implementations. (And yes, I am aware that a freestanding implementation need not require a function main() as the start point.) If your code is ‘good’ and has functions declared or defined with prototypes before use and no implicit int types (and all functions defined using prototype notation would be strongly recommended), then what was good for a C90 freestanding program will work for C99 or C11.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MPI program which compiles and runs, but I would like to
I'm currently implementing a profiling system into an application. I have a two macro
I would like to have a generic Interpolator class which can interpolate between instances
I'm building a datastructure class with an std-like interface, and implementing different iterators for
I'm developing cross-platform project that would support : Four C++ compilers - GCC, MSVC,
I'm implementing some type ( MyType in the example below) which has a Collection
I am implementing a family tree using Strawberry Prolog (what the computer labs have
I always thought an SQL compiler would break but apparently nesing can nearly be
I'm fine working on Linux using gcc as my C compiler but would like
Would a C++ CLI compiler be able to compile some large sets of C++

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.