Re:Tell HN: C Experts Panel – Ask us anything about C
by rseacord on Tuesday April 14, 2020 @12:05PM
(#22867638)
I would say that there is a lot of concern in the committee about how compilers are optimizing based on pointer providence. There has been a study group looking at this. It now appears that they are likely to publish their proposal as a Technical Report.
[ Parent
| on HN ]
Re:Tell HN: C Experts Panel – Ask us anything about C
by _kst_ on Tuesday April 14, 2020 @02:14PM
(#22869429)
"based on pointer providence"
I think you meant "provenance" (mentioning it for the sake of anyone who wants to search for it).
Re:Tell HN: C Experts Panel – Ask us anything about C
by rseacord on Tuesday April 14, 2020 @05:56PM
(#22872000)
Yes, my mistake--I was thinking of Rhode Island. I wrote a short bit about this at https://www.nccgroup.trust/us/about-us/newsroom-and-events/b... if anyone is interested.
Re:Tell HN: C Experts Panel – Ask us anything about C
by flatfinger on Wednesday April 15, 2020 @06:14PM
(#22883728)
What makes pointer provenance really great is that clang and gcc will treat that pointers that are observed to have the same address as freely interchangeable, even if their provenance is different. Clang sometimes even goes so far with that concept that even uintptr_t comparisons won't help.
extern int x[],y[];
int test(int i)
{
y[0] = 1;
if ((uintptr_t)(x+5) == (uintptr_t)(y+i))
y[i] = 2;
return y[0];
}
If this function is invoked with i==0, it should be possible for y[0] and the return value to both be 1, or both be 2. If x has five elements, however, and y immediately follows it, clang's generated code will set y[0] to 2 and yet return 1. Cool, eh?
Re:Tell HN: C Experts Panel – Ask us anything about C
by revertts on Tuesday April 14, 2020 @01:44PM
(#22868985)
What's the best way to keep an eye out for that TR? Periodically checking http://www.open-std.org/jtc1/sc22/wg14/ ?
I can't ever tell if I'm looking in the right place. :)
Re:Tell HN: C Experts Panel – Ask us anything about C
by AaronBallman on Tuesday April 14, 2020 @02:26PM
(#22869589)
If you're interested in the final TR, I would imagine we'd list it on that page you linked. If you're interested in following the drafts before it becomes published, you'd fine them on http://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log... (A draft has yet to be posted, though, so you won't find one there yet.)