On Mon, Dec 12, 2011 at 10:06 AM, Pascal Stumpf <pascal.stu...@cubes.de> wrote:
> On Mon, 12 Dec 2011 16:55:04 +0100 (CET), Mark Kettenis wrote:
>> > Date: Mon, 12 Dec 2011 16:51:48 +0100
>> > From: Pascal Stumpf  <pascal.stu...@cubes.de>
>> >
>> > On Mon, 12 Dec 2011 16:26:42 +0100, Marc Espie wrote:
>> > > On Mon, Dec 12, 2011 at 04:00:44PM +0100, Pascal Stumpf wrote:
>> > > > On Mon, 12 Dec 2011 14:41:45 +0100 (CET), Mark Kettenis wrote:
>> > > > >
>> > > > > The s/restrict/__restrict/g in cstdio shouldn't be necessary.
>> > > >
>> > > > Apparently, clang++ interprets "restrict" as parameter name, i.e.:
>> > > >
>> > > > attr.cc:1:50: error: redefinition of parameter 'restrict'
>> > > > extern "C" int foo(const char * restrict, char * restrict, ...)
>> > > >                                                  ^
>> > > > attr.cc:1:33: note: previous declaration is here
>> > > > extern "C" int foo(const char * restrict, char * restrict, ...)
>> > > >                                 ^
>> > > >
>> > > > This might indeed be a bug, but I'd have to read the C++ standard to be
>> > > > sure.  In pure C, clang doesn't complain.
>> > >
>> > > I'm not that surprised. restrict is C99.  It's not part of C++98.
>> > >
>> > > Googling for restrict and C++ show various bug-reports explicitly stating
>>  tha
>> > > t
>> > > library headers should probably adapt.
>> > >
>> > > I don't have access to C++ 2011 yet, but from n3242, it seems that it doe
>> s
>> > > now refer to C99 instead of C89, so restrict is probably leggit in C++201
>> 1.
>> > >
>> > > So it looks to me like clang in C++98 mode is totally right to not recogn
>> ize
>> > > restrict as a keyword!
>> >
>> > Yes, you're right.  And clang++ -std=c++0x does recognise restrict as a
>> > keyword.  cstdio should be adapted (and gcc 4.6 does indeed have
>> > __restrict over restrict).
>>
>> Still worth checking if only removing the XXX_CHECK defines and
>> leaving the XXX_DYNAMIC defines helps.
>
> Yes, it does. :)  Thanks!
>

pascal,
thanks for the persistent follow-up. all, please get this in.

finally clang++ is usable, and can be used without any problems in ports!

thanks

Reply via email to