Page MenuHomePhabricator

[OpenCL] Disable && (address of label) GNU extension for OpenCL

Authored by echuraev on Nov 16 2016, 1:52 AM.



Patch by Guy Benyei

Diff Detail

Event Timeline

echuraev updated this revision to Diff 78147.Nov 16 2016, 1:52 AM
echuraev retitled this revision from to [OpenCL] Disable && (address of label) GNU extension for OpenCL.
echuraev updated this object.
echuraev added a reviewer: cfe-commits.
bader removed a reviewer: cfe-commits.
bader added a subscriber: cfe-commits.
Anastasia edited edge metadata.Nov 16 2016, 10:01 AM

It seems that this bit is accepted under -std=c99 and the warning is given with the -pedantic flag. I am not sure whether it adds much deviating the implementation from C here. The OpenCL spec doesn't seem to contain anything on this matter? But if we decide to be more strict, could we try to keep it consistent with the C implementation (perhaps we could give the same diagnostic as C does as an error instead or a warning).

Also this bit gives different error in C:

int a;
void *p = &&a;
error: use of undeclared label 'a'

It doesn't seem like any of the errors for that code is more logical or precise. But if I would have to pick among equivalent approaches I would go for keeping it coherent with C.

rsmith added a subscriber: rsmith.Nov 16 2016, 1:35 PM

Please don't ban things just because you can. If there's some reason why this doesn't make sense in OpenCL, this may be fine, but generally you shouldn't be making this language mode deviate from clang's normal behaviour regarding extensions.

(It would be great if we had a flag to turn off gnu extensions other than -pedantic-errors, like we have for MS extensions, but that's mostly orthogonal to OpenCL.)

Please do not remove anything, since it may be useful in some contexts.

I do not think there are negative tests in the Khronos OpenCL conformance test suite anyway.

echuraev abandoned this revision.Nov 25 2016, 3:33 AM