bug-gnulib
[Top][All Lists]
Advanced

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

Re: ASCII_ONLY?


From: Ben Pfaff
Subject: Re: ASCII_ONLY?
Date: Fri, 07 Dec 2012 21:18:35 -0800
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Bruno Haible <address@hidden> writes:

>> gnulib has three definitions of ASCII_ONLY in files that #include
>> "vasnprintf.c":
>> 
>> lib/unistdio/u16-vasnprintf.c:#define ASCII_ONLY 1
>> lib/unistdio/u32-vasnprintf.c:#define ASCII_ONLY 1
>> lib/unistdio/u8-vasnprintf.c:#define ASCII_ONLY 1
>> 
>> But I don't see any actual uses of this macro.  What is the
>> intent?  (Is it related to FCHAR_T_ONLY_ASCII?)
>
> Bingo! The comments in vasnprintf.c say:
>
>      FCHAR_T_ONLY_ASCII Set to 1 to enable verification that all characters
>                         in the format string are ASCII. MUST be set if
>                         FCHAR_T and DCHAR_T are not the same type.
>
> And in lib/unistdio/u{8,16,32}-vasnprintf.c FCHAR_T and DCHAR_T are indeed
> not the same type. Therefore the 3 files should define FCHAR_T_ONLY_ASCII,
> not ASCII_ONLY.
>
> I would be grateful to you if you could commit the obvious fix.
>
> Did you find this by code inspection, or through a gcc or clang warning?

I found it by code inspection.  Working on a new user of vasnprintf.c
(see http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00022.html),
and examining the existing users, I saw the definition of ASCII_ONLY,
but couldn't figure out what it was good for.

Thanks, Bruno and Paul.



reply via email to

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