[Patch] C1X threading support

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Dec 20 14:58:24 UTC 2011


In message <4EF09D0E.10213.B663FC80 at 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 at 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.


More information about the freebsd-arch mailing list