tup icon indicating copy to clipboard operation
tup copied to clipboard

#pragma once on Linux Clang fails on random files, but deterministic

Open datgame opened this issue 7 years ago • 3 comments

On the rare random occasion, this include guard problem happens when using #pragma once:

game//home/datgame/dev/project/game/sound.h:42:8: error: redefinition of "Sound_memory"
struct Sound_memory {
       ^
game/./sound.h:42:8: note: previous definition is here
struct Sound_memory {

Adding ordinary #ifndef/#define#endif include guards fixes it.

datgame avatar Feb 05 '19 09:02 datgame

Does this happen with both GCC and Clang?

jhasse avatar Mar 20 '19 14:03 jhasse

It only happens with Clang. GCC and MSVC don't have this problem. (my game compiles with all 3)

datgame avatar Mar 22 '19 10:03 datgame

For me too. I also think that it started to happen in a recent clang version.

jhasse avatar Mar 22 '19 10:03 jhasse