logoalt Hacker News

rfgplkyesterday at 4:52 PM2 repliesview on HN

The language is already littered with these "the compiler shall insert" and then a reference to the STANDARD LIBRARY FEATURE N.X. Which means if you're compiling in a freestanding environment half the time you'll get linker errors such as "couldn't find symbol whatever". And what's worse the compiler inserts a call to a function that is LITERALLY STD NAMESPACED. Meaning you have to provide that signature yourself. See how std vector is hardcoded into compare/meta and I can't remember what else.

This then forces developers to create undefined behaviour because according to the standard you can't namespace std your own functions even though it's required to get it to work.


Replies

ameliaquiningyesterday at 8:27 PM

Freestanding environments specifically don't have to do this, they get a carve-out. (I dunno if this applies elsewhere though.)

mitxelatoday at 12:34 AM

Sounds like a compiler bug that a standard feature implementable in freestanding doesn't work in freestanding.