"David Laight" [off-list ref] writes:
quoted
quoted
quoted
Or write it as (!field || !(typeof(field))~field) which more
closely
quoted
quoted
quoted
resembles what the macro name expresses.
Better still, or maybe:
field == 0 || field == (typeof field)~0
Which doesn't work when sizeof(field) > sizeof(int).
Needs another cast.
field == 0 || field == (typeof field)~(typeof field)0
You can avoid that by using (typeof field)-1.
Gah, I thought I knew the integral promotion rules!
-1 and ~0 are both 'integer' and get treated the same.
A quick test shows that gcc does sign extend when converting
32bit int to 64bit unsigned long long.
Which probably means that is required by the standard!
David