cc99standard-libraryopenvmsstdint

stdint.h and C99


I read in the C99 standard that stdint.h is part of the C standard library.

Do I read correctly that, if I test for C99 compliance, using:

defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)

that means stdint.h is supposed to be available?

Case in point: can I consider an environment which pretends to be C99 compliant but doesn't provide stdint.h to be at odds with its own compliance statement, hence buggy?

Edit : for the curious ones, the system in question is OpenVMS with HP C Compiler (not gcc, which on openVMS does provide stdint.h). So according to answers and comments received so far, I have to consider this implementation (which pretends to be C99) as buggy. For more details : https://groups.google.com/forum/#!topic/comp.os.vms/Bnh3tIOc7bo%5B101-125%5D


Solution

  • Yes.

    Incidentally, undefined symbols expand to 0 in preprocessor expressions, so you could just write:

    #if __STDC_VERSION__ >= 199901L
    

    On the other hand, an implementation that doesn't claim to conform to C99 (or C11) might still support <stdint.h> as an extension.