Posted Nov 2, 2011 21:31 UTC (Wed) by khim
In reply to: I think it's pretty clear, actually...
Parent article: libabc: a demonstration library for kernel developers
When include files are copied around they sometimes treated as the same from "#pragma once" POV (if copying process keeps the timestamps) and sometimes as different (if you put them in GIT and pull back).
Thus "#pragma once" is great way to create unreproducible build failures. With explicit include guard you sometimes trigger the GCC optimization (GCC does not reread file with include guard it it can understand that it's the same file) and sometimes it fails and GCC actually loads and parses file again - but it only affects compilation speed, never correctness.
to post comments)