bug-gnulib
[Top][All Lists]
Advanced

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

Re: ASSERT and SIGNATURE_CHECK macros


From: Eric Blake
Subject: Re: ASSERT and SIGNATURE_CHECK macros
Date: Wed, 23 Dec 2009 21:45:27 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

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

> So, how to resolve this contradicting requirements?
> 
> Possibility 1: Put the SIGNATURE_CHECK into a file tests/signature.h, and put
> ASSERT, SIZEOF and a few others into tests/macros.h. A test looks like this:
> 
>    #include <config.h>
> 
>    #include <specification.h>
> 
>    #include "signature.h"
>    SIGNATURE_CHECK (...);
> 
>    #include <other.h>
>    #include <other2.h>
>    #include "macros.h"
> 
> Possibility 2: Keep the SIGNATURE_CHECK definition in config.h, on behalf of
> m4/gnulib-common.m4, and put ASSERT, SIZEOF and a few others into 
tests/macros.h.
> A test looks like this:
> 
>    #include <config.h>
> 
>    #include <specification.h>
> 
>    SIGNATURE_CHECK (...);
> 
>    #include <other.h>
>    #include <other2.h>
>    #include "macros.h"
> 
> I've explained why possibility 1 is preferable, but now I am actually 
undecided.
> What do you think?

It's less work for me if we go with possibility 2, but I have no qualms with 
the work to go with possibility 1.  Either way we create macros.h and put 
ASSERT there, and the creation of macros.h is now decoupled from my signature 
check macro.  The difference all boils down to whether SIGNATURE_CHECK is in 
its own header ("signature.h", affecting only the unit tests that include it), 
or whether it is in a common header (<config.h>, and probably should be named 
_GL_SIGNATURE_CHECK to avoid pollution, since config.h is also included by the 
actual project).  I'm 55-45 for going with option 1.  Anyone else want to speak 
up?

-- 
Eric Blake






reply via email to

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