[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ASSERT and SIGNATURE_CHECK macros
From: |
Bruno Haible |
Subject: |
Re: ASSERT and SIGNATURE_CHECK macros |
Date: |
Wed, 23 Dec 2009 19:57:12 +0100 |
User-agent: |
KMail/1.9.9 |
Hi Eric,
> that also means that test/macros.h must NOT include any system headers (so
> that
> SIGNATURE_CHECK can be invoked after config.h, macros.h, and exactly one
> system
> header has been included).
Thanks for stating this so clearly. Because on the other hand, I would like
tests/macros.h to #include <stdio.h> and <stdlib.h>, so that the test author
is freed from including these just for ASSERT. And in case ASSERT is ever
changed to use <execinfo.h> or some other header files, I don't want to
change 300 test files.
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?
Bruno
- 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 <=
- Re: ASSERT and SIGNATURE_CHECK macros, Eric Blake, 2009/12/23
- 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