Skip to content

Comment on UndefinedBehaviorSanitizer's Unexpected Behavior

Comments

Yes, it's very much undefined behavior. As I recall, GTK's glib does this all over the place for signals.

edit: I'm not advocating that this being UB is fine. I don't expect compilers to exploit this for optimization, because so many projects rely on this working. There might be room to extend compatible function types to make this defined.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.