Paul Eggert wrote: > The declarations should be marked. For example, the declaration of argmatch > should be marked with _GL_ATTRIBUTE_PURE (or _GL_PURE) in argmatch.h.
Yes. Good point. Jim, in the current idioms with macros from c++defs.h the attribute needs to be added in the _GL_FUNCDECL_RPL and _GL_FUNCDECL_SYS invocations, but should not be added in the _GL_CXXALIAS_RPL and _GL_CXXALIAS_SYS invocations. Example from stdio.in.h: _GL_FUNCDECL_RPL (obstack_printf, int, (struct obstack *obs, const char *format, ...) _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) _GL_ARG_NONNULL ((1, 2))); _GL_CXXALIAS_RPL (obstack_printf, int, (struct obstack *obs, const char *format, ...)); # else # if !@HAVE_DECL_OBSTACK_PRINTF@ _GL_FUNCDECL_SYS (obstack_printf, int, (struct obstack *obs, const char *format, ...) _GL_ATTRIBUTE_FORMAT_PRINTF (2, 3) _GL_ARG_NONNULL ((1, 2))); # endif _GL_CXXALIAS_SYS (obstack_printf, int, (struct obstack *obs, const char *format, ...)); > This affects Bruno's point that the lines all have enough room > for _GL_ATTRIBUTE_CONST etc.; I expect that point no longer holds > once declarations are marked. In these idioms you can reserve an extra line per attribute declaration. In glibc, Ulrich Drepper hoisted as many attribute and other declarations into as few lines as possible. You can see the result: inconsistent formatting, and macros like __wur. Ugly. Bruno -- In memoriam Itzhak Katzenelson <http://en.wikipedia.org/wiki/Itzhak_Katzenelson>