News for hackers. Stuff that matters.
Re:Notes on Programming in C (1989) by pjmlp on Sunday May 11, 2014 @11:04AM (#7728839)
Because it is an optimization that relies on well behaved developers and we all know how good such assumptions end, specially in big teams with high attrition.
Re:Notes on Programming in C (1989) by dllthomas on Sunday May 11, 2014 @11:58AM (#7728976)
As I read this, if the compiler determines that (with the #define set) the file is effectively empty, it knows it can just check the #define next time rather than re-reading. Without this optimization, you get the same result slower. It doesn't depend on well-behaved anything to get a result just as correct as without the optimization.

With the single possible exception of a file that changes on disk between the multiple includes in the same build step. That is not a situation I have ever encountered and I am not at all sure it is supported and there aren't a bazillion other things that would break it in any given compiler chain (certainly at least line directives would be wrong, but that's arguably minor I guess).

Re:Notes on Programming in C (1989) by Peaker on Monday May 12, 2014 @03:22AM (#7731531)
It doesn't rely on anything. It's a correct optimization that does not change any behavior at all. It only speeds things up.