Items tagged with: define

Search

Items tagged with: define


Implicit member variables (in C++).

Now let's use #define to shadow the variable as field of a struct field of a scruct. Something like that.

Pointer as array as pointer and the associated arithmetics. Where are we in the buffer again?

Also for loops assign and compare and assign. And of course at lot of UB.

Etc.


every C compiler vendor should be pressured to implement gnu-style statement expressions so that you can just do:

#define IS_EQUAL(x, y) \
(sizeof(({ \
[[maybe_unused]] __typeof(x) *y_= &(y); \
0; \
})), \
memcmp(&(x), &(y), sizeof(x)) == 0)


ah, that fixes the space prefix bug i saw, but the #[url=https://tech.lgbt/tags/define]define[/url] strncasecmp causes some windows builds to fail, which i was going to put in a pull request for


The number of times I’ve needed to #define an alias to deal with naming collisions makes me vaguely glad of the objective-c habit of domain-abbreviated prefixes, but wishes there was a better way to accomplish it in plain old C.