[vlc-devel] [PATCH] Use character classes instead of ranges in check_headers.
aballier at gentoo.org
Mon Jun 29 11:27:08 CEST 2009
On Sun, 28 Jun 2009 21:18:16 +0300
"Rémi Denis-Courmont" <remi at remlab.net> wrote:
> Le dimanche 28 juin 2009 16:51:10 Alexis Ballier, vous avez écrit :
> > This fixes weird check_headers failures when it also matches things
> > like 'const' which are obviously allowed in the public headers and
> > cause check failures due to these false positives.
> This check is supposed to match upper-case and digit ASCII characters
> (not just any upper-case or digit in the user locale). If some value
> besides WORDS_BIGENDIAN is mismatched, then it should be removed
> explicitly, but I do not see why 'const' would need such treatment.
It seems I failed at explaining the problem... its not about special
casing const; its due to the fact that sed uses LC_COLLATE for
character ranges. Lets see an example:
$ cat foo
$ LC_COLLATE=C sed -n -e 's/^#undef \([A-Z0-9_]*\)$/\1/p' foo
$ LC_COLLATE=en_US sed -n -e 's/^#undef \([A-Z0-9_]*\)$/\1/p' foo
LC_COLLATE in my en_US utf8 locale orders characters with 'aAbB...zZ',
therefore const is, unexpectedly, in [A-Z]*.
If your sed does not exhibit this behavior, please try with sed 4.2.1.
As I don't think anything non ASCII would end up in config.h.in,
[:upper:] and friends should just be fine, but if you really want to
preserve A-Z ranges, LC_ALL or LC_COLLATE/LC_CTYPE should be set to C
somewhere as described in the '`[a-z]' is case insensitive' paragraph
of the 'Reporting Bugs' section in sed info page.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 198 bytes
Desc: not available
More information about the vlc-devel