[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-zile] Re: string.h uses restrict
From: |
Jim Meyering |
Subject: |
[Bug-zile] Re: string.h uses restrict |
Date: |
Thu, 19 Mar 2009 12:06:41 +0100 |
Reuben Thomas wrote:
> On Wed, 18 Mar 2009, Eric Blake wrote:
>
>> Ahh. The bug is in zile, not gnulib.
>
> Ah, thanks very much, and apologies for the noise.
Always including <config.h> first is easy to forget.
You might want to use rules like these from gnulib's maint.mk:
# Nearly all .c files must include <config.h>.
sc_require_config_h:
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
grep -L '^# *include <config\.h>' \
$$($(VC_LIST_EXCEPT) | grep '\.c$$') \
| grep . && \
{ echo '$(ME): the above files do not include <config.h>' \
1>&2; exit 1; } || :; \
else :; \
fi
# You must include <config.h> before including any other header file.
sc_require_config_h_first:
@if $(VC_LIST_EXCEPT) | grep '\.c$$' > /dev/null; then \
fail=0; \
for i in $$($(VC_LIST_EXCEPT) | grep '\.c$$'); do \
grep '^# *include\>' $$i | sed 1q \
| grep '^# *include <config\.h>' > /dev/null \
|| { echo $$i; fail=1; }; \
done; \
test $$fail = 1 && \
{ echo '$(ME): the above files include some other header' \
'before <config.h>' 1>&2; exit 1; } || :; \
else :; \
fi
[Bug-zile] Re: string.h uses restrict, Bruno Haible, 2009/03/19