r184005 - Suppress the c++11 -Wdeprecated warning for 'register' ifit is expanded from a

Eli Friedman eli.friedman at gmail.com
Sun Jun 16 10:28:25 PDT 2013


On Sun, Jun 16, 2013 at 9:15 AM, Andy Gibbs <andyg1001 at hotmail.co.uk> wrote:

> On Friday, June 14, 2013 11:05 PM, Richard Smith wrote:
>
>> Author: rsmith
>> Date: Fri Jun 14 16:05:24 2013
>> New Revision: 184005
>>
>> URL: http://llvm.org/viewvc/llvm-**project?rev=184005&view=rev<http://llvm.org/viewvc/llvm-project?rev=184005&view=rev>
>> Log:
>> Suppress the c++11 -Wdeprecated warning for 'register' if it is expanded
>> from a
>> macro defined in a system header. glibc uses it in macros, apparently.
>>
>
> Not just glibc, I'm afraid.  Here's the output from using python headers:
>
> In file included from /usr/include/python2.7/Python.**h:94:
> /usr/include/python2.7/**stringobject.h:173:5: warning: 'register'
> storage class specifier is deprecated [-Wdeprecated]
>    register PyObject *obj,     /* string or Unicode object */
>    ^~~~~~~~~
> /usr/include/python2.7/**stringobject.h:174:5: warning: 'register'
> storage class specifier is deprecated [-Wdeprecated]
>    register char **s,          /* pointer to buffer variable */
>    ^~~~~~~~~
> /usr/include/python2.7/**stringobject.h:175:5: warning: 'register'
> storage class specifier is deprecated [-Wdeprecated]
>    register Py_ssize_t *len    /* pointer to length variable or NULL
>    ^~~~~~~~~
>
> I expect it is unreasonable to ask for all "system" headers to be exempt


No, it's perfectly reasonable; in fact, we already suppress warnings
pointing into system headers unless you specify -Wsystem-headers.  That
said, if your command line has something like "-I/usr/include/python2.7",
we don't recognize it as a system header.  You can use "-isystem
/usr/include/python2.7" to make clang treat the Python headers as system
headers.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130616/b21dc99d/attachment.html>


More information about the cfe-commits mailing list