News for hackers. Stuff that matters.
Re:Fat pointers in C using libcello by pjmlp on Wednesday April 29, 2020 @10:53AM (#23019974)
So what? Unless you include std...h you also need to use _Bool, _Complex and so forth, hardly much different.
Re:Fat pointers in C using libcello by int_19h on Wednesday April 29, 2020 @06:48PM (#23025478)
But the repo doesn't include them - it defines them itself.

Technically, I believe this is actually UB, just like any other #define for a keyword or an identifier from the standard library.

Re:Fat pointers in C using libcello by pjmlp on Thursday April 30, 2020 @02:49AM (#23028111)
I don't follow.

When I do #include <stdbool.h> it also brings the #define bool _Bool, a keyword from the standard library.

How is it UB?

Re:Fat pointers in C using libcello by int_19h on Friday May 01, 2020 @09:32PM (#23048295)
It's not UB to #include standard headers that do such things. It is UB to #undef or redefine them yourself, though. And it looks like <stdbool.h> gets an explicit exemption, at least in C11:

"Notwithstanding the provisions of 7.1.3, a program may undefine and perhaps then redefine the macros bool, true, and false"

I guess it's because defining these was so common even before C99. But there's no similar verbiage for <iso646.h>, so...