C++ standard header inclusion artifact?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I'm wishing to use some exact width integer types with

g++ (GCC) 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)

I believe that uint32_t and stuff like that are not part of C++'s
14882 standard, they are part of C's C99 standard (and defined in
stdint.h)

This tiny program:
class A {
  public:
    static const uint32_t k = 256;
};
int main() { }

Doesn't compile:

uint$ g++ *.cc -o main -Wall -std=c++98
main.cc:3: error: 'uint32_t' does not name a type

This seems right; however the inclusion of this line (at the beginning)

#include <iostream>

is enough to have it compiling smoothly with the same former command
(no console output).

Is this right? I'd have say (guessed) that that shouldn't happen.

Or is this an implementation detail that shouldn't be relied on?

Thanks a lot in advance for your help.

--
Rodolfo Federico Gamarra

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux