Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 20 Dec 2011 14:58:22 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        "Niall Douglas" <s_sourceforge@nedprod.com>
Cc:        threads@freebsd.org, arch@freebsd.org
Subject:   Re: [Patch] C1X threading support
Message-ID:  <78107.1324393102@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 20 Dec 2011 14:34:54 GMT." <4EF09D0E.10213.B663FC80@s_sourceforge.nedprod.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In message <4EF09D0E.10213.B663FC80@s_sourceforge.nedprod.com>, "Niall Douglas"
 writes:

>There's a LOT of optional stuff in C11.

And then there are non-optional stuff like <nostdreturn.h>, specified
so it leaves no doubt, except as to the sanity of the authors.


As best I can gather, at one point ISO C decided to use

	'_' Uppercase Lowercase+digit+'_'*

for keywords, and that begat us '_Complex', '_Alignas' (a famous greek
poet ?), '_Generic'', and also '_Noreturn'.

Then somebody probably pointed out that

	inline _Noreturn foo(int bar);

just looked plain ugly.

Then some smart person came up with <nostdreturn.h> which shall
contain, exactly and only:

	#define noreturn _Noreturn

So that we can write:

	#include <stdnoreturn.h>

	inline noreturn foo(int bar);


Now, explain to me, why this was more important, and got included,
than being able to say:

	struct foo_protocol_header {
		little_endian uint16_t 	proto_ver	@ 0,
		little_endian uint32_t	seq_no		@ 4,
		little_endian uint32_t	ack_no		@ 10,
		little_endian uint8_t	proto_req	@ 16,
	};

And have the compiler do the error-prone idiot-work for us, no
matter which platform or compiler we use ?

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?78107.1324393102>