bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clang and _Noreturn


From: Bruno Haible
Subject: Re: clang and _Noreturn
Date: Tue, 25 Apr 2017 07:26:31 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-72-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

> > If we want to offer a short macro name, such as _GL_NORETURN, it should
> > be usable in both places, function declarations and function pointers.
> > That is, make it an alias of _GL_NORETURN_FUNCPTR.
> ...
> Function pointers are relatively rare compared to function definitions 
> and declarations, so a short name is more-important for the latter.

When designing the naming conventions in an API, it's better ignore which
parts of the API will be used frequently or rarely. Better think only at
how easy it is to remember each item.

I buy "frequent" vs. "rare" considerations only for the function prototypes
and the implementation of an API.

> > GCC and clang, at least, prefer 'extern' after '[[noreturn]]'.
>
> I vaguely recall problems with putting _Noreturn first, maybe for 
> compilers that lacked native _Noreturn. Why, for example, was this patch 
> made to clisp in 2011?
> 
> http://hg.code.sf.net/p/clisp/clisp/rev/c5ba2cfdd7fd?revcount=480

Good point. This patch was a followup of
http://hg.code.sf.net/p/clisp/clisp/rev/84e10af84db9
I guess I need to test things with some older versions of gcc and g++ as well,
and with MSVC, before we can jump to conclusions.

Bruno




reply via email to

[Prev in Thread] Current Thread [Next in Thread]