DT_REG uneclared (first use in this function) and -std = c99

I am writing a C program using the Eclipse CDT. I want to initialize mine for loops like this ...

for( int i = 0; i < 5; i++ )

so I added -std = c99 to the gcc command line. This has the side effect of throwing an error: "DT_REG uneclared (first use in this function) for the line:

if( dir_ent->d_type != DT_REG )

DT_REG is defined in dirent.h (which is included). The code compiles fine without -std = c99 on the gcc command line. What am I missing?

+3
source share
1 answer

-std=gnu99? , d_type (. GNU libc " " ), , . , _BSD_SOURCE ( _GNU_SOURCE), .

+3

Source: https://habr.com/ru/post/1794642/


All Articles