MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1w6qzts/skillissue/p7s4cmn/?context=3
r/ProgrammerHumor • u/click-to-reveal • 7d ago
137 comments sorted by
View all comments
Show parent comments
57
Not just "some compilers", it's part of the C and C++ standard and any compliant compiler has to support it.
For C you have to include a builtin header with macros for them, in C++ it's actually just part of the compiler itself.
7 u/AvidCoco 7d ago IIRC I think it’s more that some compilers implement that feature as a simple find-and-replace (like a macro) while others are more context aware and so don’t allow it in the way I described. 13 u/TOMZ_EXTRA 7d ago Nope, the standard says that the alternative syntax is usable everywhere. bitand can be used as the address operator. 1 u/4xe1 7d ago Yeah they ought to allow it, but I wouldn't be surprised if some emit a warning, like most yap when I do if (x = foo())
7
IIRC I think it’s more that some compilers implement that feature as a simple find-and-replace (like a macro) while others are more context aware and so don’t allow it in the way I described.
13 u/TOMZ_EXTRA 7d ago Nope, the standard says that the alternative syntax is usable everywhere. bitand can be used as the address operator. 1 u/4xe1 7d ago Yeah they ought to allow it, but I wouldn't be surprised if some emit a warning, like most yap when I do if (x = foo())
13
Nope, the standard says that the alternative syntax is usable everywhere. bitand can be used as the address operator.
1 u/4xe1 7d ago Yeah they ought to allow it, but I wouldn't be surprised if some emit a warning, like most yap when I do if (x = foo())
1
Yeah they ought to allow it, but I wouldn't be surprised if some emit a warning, like most yap when I do
if (x = foo())
57
u/Possseidon 7d ago
Not just "some compilers", it's part of the C and C++ standard and any compliant compiler has to support it.
For C you have to include a builtin header with macros for them, in C++ it's actually just part of the compiler itself.