bug-gnulib
[Top][All Lists]
Advanced

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

Re: pure and const function attributes


From: Bruno Haible
Subject: Re: pure and const function attributes
Date: Sun, 03 May 2020 12:56:42 +0200
User-agent: KMail/5.1.3 (Linux/4.4.0-177-generic; KDE/5.18.0; x86_64; ; )

Hi Paul,

Looks very good.

In attribute.h:
> +/* Attributes from GCC have macro names beginning with 'ATTRIBUTE_' to
> +   avoid name clashes.  */

Maybe add a pointer to the GCC documentation?
https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html

In dfa.c:
># if 201710L < __STDC_VERSION__
>#  define FALLTHROUGH [[__fallthrough__]]

This is ugly, but the ISO C committee appears to have chosen this syntax. See

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2335.pdf

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2187.pdf
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2307.pdf
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2376.pdf

In mbrtoc32.c and nstrftime.c:
I would write
  #include "attribute.h"
not
  #include <attribute.h>
since it's not a standardized header.

At some point, we may be able to remove lib/unused-parameter.h. But IMO
this should wait until we've gained experience with attribute.h.

Bruno




reply via email to

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