Why does uint from <sys / types.h> disappear with -std = c99?
// Filename: test.c #include <sys/types.h> int main() { uint a; return 0; } The above code can be compiled using gcc and clang with standard ones like gnu89 or gnu99. In other words, the following work.
$gcc test.c # for the default is std=gnu89 $clang test.c # for the default is std=gnu99 However, the following happens with an error: "uneclared uint".
$gcc -std=c99 test.c $clang -std=c99 test.c Can someone explain why the uint definition disappears for the c99 standard?
+4
2 answers
The content is shown in here , and the uint-related part is entered as:
#ifdef __USE_MISC /* Old compatibility names for C types. */ typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; #endif This fooobar.com/questions/1469887 / ... tells us where this particular macro comes from with some basic explanation.
Careful research shows that SVID is also one standard backed by this . The GNU, gnu89, and gnu99 standards probably cover as much material as possible, so the resulting behavior, which uint is not included in C99, but the default default gcc and clang, is understandable.
+1