logoalt Hacker News

quotemstr12/09/20242 repliesview on HN

Yes, it's both. It works fine in real world million line codebases. I have never, not once, seen a bug or portability issue caused by it. I have seen multiple header guard macro names collide.

Eschewing pragma once these days is pure ignorance and superstition --- then again, so is writing new code in C at all.


Replies

uecker12/09/2024

This good for you, other people reported problems with pragma once.

And I think C is one of the better languages you could use to write code today. Also from the programs I use daily, the more stable and reliable ones tend to be written in C.

iainmerrick12/09/2024

Yep, header guard name collisions, and also typos in header guards so they don’t work as intended.