[Top][All Lists]
[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
- Re: new module 'unused-parameter', (continued)
- Re: new module 'unused-parameter', Simon Josefsson, 2009/12/27
- Re: new module 'unused-parameter', Simon Josefsson, 2009/12/29
- Re: new module 'unused-parameter', Jim Meyering, 2009/12/29
- Re: stdlib tweak, Jim Meyering, 2009/12/23
- Re: stdlib tweak, Bruno Haible, 2009/12/23
- Re: stdlib tweak, Eric Blake, 2009/12/23
- Re: stdlib tweak, Eric Blake, 2009/12/23
- Re: ASSERT and SIGNATURE_CHECK macros, Bruno Haible, 2009/12/23
- Re: ASSERT and SIGNATURE_CHECK macros,
Eric Blake <=
- Re: ASSERT and SIGNATURE_CHECK macros, Eric Blake, 2009/12/24
- Re: ASSERT and SIGNATURE_CHECK macros, Jim Meyering, 2009/12/24
- Re: SIGNATURE_CHECK, Bruno Haible, 2009/12/24
- Re: SIGNATURE_CHECK, Eric Blake, 2009/12/24
- Re: SIGNATURE_CHECK, Bruno Haible, 2009/12/24
- Re: SIGNATURE_CHECK, Eric Blake, 2009/12/24
- Re: ASSERT macro, Bruno Haible, 2009/12/24
- SIZEOF macro (was: ASSERT macro), Eric Blake, 2009/12/24
- Re: SIZEOF macro, Eric Blake, 2009/12/24
- Re: SIZEOF macro, Jim Meyering, 2009/12/25