[cfe-dev] Adding a new pragma to Clang
dsutherland at cert.org
Thu Jan 9 07:13:52 PST 2014
It’s certainly *possible* to enable c++ attribute syntax for C99; we’ve done so experimentally in-house. Whether it’s a *good* idea is a whole different question.
We (some CERT folks, in loose collaboration with DeLesley Hutchins at Google) are working on a concurrency-related static analysis that needs attributes. Our funders would like C (actually C11) support as well as C++ support. If we had attribute support for C11, our remaining C++ work would suffice to handle all the relevant C issues as well.
C11-with-C++11-attributes would be a thoroughly non-standard language, of course. However, the particular attributes we’re interested in have no effect whatsoever on code generation or optimization; they’re purely for static analysis.
It sure would be nice to be able to enable C++11 attribute syntax for some flavor of C, with in-tree support.
dsutherland at cert.org<mailto:dsutherland at cert.org>
On Jan 9, 2014, at 4:54 AM, Renato Golin <renato.golin at linaro.org<mailto:renato.golin at linaro.org>> wrote:
On 8 January 2014 18:41, Arnold Schwaighofer <aschwaighofer at apple.com<mailto:aschwaighofer at apple.com>> wrote:
Could we enable c++ attribute syntax for c99 (via a command line flag)?
This falls too close to Clang-specific behaviour for my liking... One alternative would be to compile a C99 file in C++11 mode, but you'll end up with different semantics that the original code might not have intended.
cfe-dev mailing list
cfe-dev at cs.uiuc.edu<mailto:cfe-dev at cs.uiuc.edu>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev