Re:Notes on Programming in C (1989)
by stormbrew on Sunday May 11, 2014 @07:16AM
(#7728399)
It's pretty unlikely that list.h would have a trivial include guard, so I don't see how the above optimization would break it. An include guard in list.h would prevent you from using it properly with or without the optimization.
[ Parent
| on HN ]
Not when you #undef it. That was just a possible example.
If list.h has no include guard, it gets included with or without this optimization. If it has an include guard and you #undef it, then it gets included again with or without this optimization. If you it has an include guard and you do not #undef it, it does not get included again, with or without this optimization.
In no case does this optimization change the code emitted.