We seem to have a legacy header (and no process in place to change it) which looks pretty much like this: http://en.wikibooks.org/wiki/C++_Programming/ctype.h_header Clang warns on the "__attribute__ ((__const))" part: warning: unknown attribute '__const' ignored [-Wunknown-attributes] __attribute__ ((__const)); ^ I propose to add '__const' as an attribute, becoming synonymous to 'const'. I am about to make a patch and shall attach it here.
Created attachment 5614 [details] fix and test A patch that strips leading '__' even when there is no trailing '__' present. And a test for it too.
Hmm... per the gcc docs, "__attribute__ ((__const))" isn't really supposed to be legal... probably an accident of keyword mapping. A patch which special-cases __const would be better, because gcc doesn't accept, for example, "__attribute__((__noreturn))".
Thanks Eli, I'll go for the simplistic variant, it is enough for our purposes.
fixed by r116570. Contains a comment. The fix is so simple, that a test for it is (IMHO) not needed, anyway our app tests it well, so I'll notice when somebody breaks it :-)
On Chandler's request, r116570 contains a test.
correction: On Chandler's request, *r116571* contains a test.