bug-gnulib
[Top][All Lists]
Advanced

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

Re: ASSERT and _GL_UNUSED macros


From: Eric Blake
Subject: Re: ASSERT and _GL_UNUSED macros
Date: Wed, 23 Dec 2009 15:47:37 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Bruno Haible <bruno <at> clisp.org> writes:

> > OK, then I'll work on making gnulib-tool always distribute tests/macros.h
> > along with any test, and move ASSERT into that file (but as separate
> > steps, to make the reviews easier).
> 
> It does not require a modification of gnulib-tool. tests/macros.h is not
> different in principle than tests/nan.h; it's only used in more places.

But that means listing tests/macros.h in more than 100 modules/*-tests files.  
There comes a point where a file is so ubiquitous that we might as well make 
its presence automatic.

> Oops, you pushed that a bit quickly. I was just saying that _UNUSED_PARAMETER_
> is a good name, and there is no reason to rename it. Your new macro _GL_UNUSED
> is used in two different syntaxes now: after the identifier (when used for a
> function parameter) and before the identifier (in _GL_CHECK_SIGNATURE).

Blame gcc for the syntax issue.  The point is that _GL_UNUSED can be attached 
to variables, functions, parameters, and even labels, according to the syntax 
rules of gcc __attribute__.

> Therefore my proposal is to
>   - create a new module 'unused-parameter', that inserts a definition of
>     _GL_UNUSED_PARAMETER_ in a header file, like 'link-warning' and 'arg-
nonnull'
>     do,
>   - update unistr.h accordingly.

Sounds reasonable.  But I'd rather see _GL_UNUSED_PARAMETER than 
_GL_UNUSED_PARAMETER_, given that we have _GL_ARG_NONNULL without a trailing 
underscore.  Also, se-context.in.h and se-selinux.in.h would benefit from an 
unused-parameter module.

-- 
Eric Blake






reply via email to

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