svn commit: r268137 - head/sys/sys

Pedro Giffuni pfg at FreeBSD.org
Sun Jun 21 16:17:31 UTC 2015



On 06/21/15 10:41, Bruce Evans wrote:
> On Sun, 21 Jun 2015, Pedro Giffuni wrote:
>
>> On 06/21/15 01:09, Bruce Evans wrote:
>>> On Sat, 20 Jun 2015, Pedro Giffuni wrote:
>> * ...
>>>> With the patch we would use:
>>>>
>>>> __Noreturn void
>>>>   foo(void) _dead2;
>>>>
>>>> Which is still ugly but C11-ish.
>>>
>>> That asks for the same problems as defining __weak.
>>>
>>> Why not just don't use _Noreturn?  It is an unimprovement on the gcc
>>> attribute.  The attribute works at the beginning or end, while Noreturn
>>> only works at the end.
>>
>> As I see it, newer (C11) software is likely to use _Noreturn in their
>> headers
>
> We can define _Noreturn to support this (but possibly shouldn't).
>
> The newer software many be pure C11.  Then it doesn't need any 
> definition,
> and just doesn't compile with non-C11 compilers.
>

Well, the fact this we just do this in the tree and no one has bothered to
"clean" the situation for older compilers just indicates that no one *cares*
about older compilers.

> If we defined _Noreturn, it would be to use it in non-C11 software, like
> we do in stdlib.h.  This is a fragile compatibility hack so it should
> be avoided if possible.  We can easily avoid it in our own headers by
> not changing anything.  Just use the old declaration, with __dead2 placed
> at the end.  Any reasonable implementation of __attribute__() must be 
> able
> to support any new attribute that a new standard might add.
>

The thing is, why bother with gnuisms at all?

I am personally OK with making it easier for everyone to use more
modern constructs but I am not going out of my way to support
gcc-1 or gcc-2.

Let's just admit it: the build is basically broken for older compilers
and no one cares enough to fix them. (Not ideal, just what we
have).

Pedro.


More information about the svn-src-head mailing list