I was sure I'd looked at this at one point and found this from years ago ...
"The discussion evolved to a related question, around #pragma once. A few years back, on the Akaros project (kernel written in C, FWIW), a Linux kernel luminary convinced us to get rid of file guards and go to #pragma once. I am not sure it was worth the trouble but we did it. It *can* speed up compile time; cpp doesn't need to process a whole file and then conclude it did not have to process it; it can realize it can skip the open. A significant downside is that it's not in any standard -- just all the compilers out there, it seems, save romcc.
I did a simple test: apply #pragma once to coreboot. A coreboot build for watson opens 80K .h files today. #pragma once makes barely any difference; this says we are doing a good job in how we use our .h files."
Anyway, all this said, #pragma once seems a good idea.
On Mon, May 16, 2022 at 9:59 AM David Hendricks david.hendricks@gmail.com wrote:
On Mon, May 16, 2022 at 8:59 AM ron minnich rminnich@gmail.com wrote:
btw, sometimes this has gone the other direction .. https://github.com/lowRISC/opentitan/pull/5693
It looks like they did that solely to conform to Google's style guide which, dogmatic as it may appear, makes sense since OpenTitan is a Google-lead project.