2 ms·
The problem with `-x c foo.h` is that `#pragma once` isn't legal in the top-level source file. There might be other problems too. Using manual header guards is
by o11c 3y ago
The problem with `-x c foo.h` is that `#pragma once` isn't legal in the top-level source file. There might be other problems too.
Using manual header guards is a bug-prone waste. Nobody has ever demonstrated me a case where `#pragma once` fails to work with compilers from the last decade or two.
- JonChesterfield 3y agoI've heard that `#pragma once` fails to work in the top-level source file, such as when compiling a header using -xc to see whether it is independently well formed...