[uClibc]Unexpected behaviour of sscanf

Manuel Novoa III mjn3 at codepoet.org
Fri May 10 21:13:45 UTC 2002


Hello,

On Thu, May 09, 2002 at 08:22:02PM -0400, Ilguiz Latypov wrote:
> 
> Marko,
> 
> The default choice for ctype calls became real functions around half a
> year ago. 

This has changed once again.  Unfortunately, when the scanf code was
written, they were functions.  I just committed a fix to CVS, but it
is untested.  Also, be aware that the ctype code may change yet again
in the next couple of weeks.  It is in flux at the moment as I
incorporate wide char and better locale support.

>           The other choice is to use macros without relying on the static
> character type table.  I think macros for ctype calls are flawed.  I

They are also allowed by the standards.  To guarantee you get the
function you can either #undef the name or invoke as (isspace)(c).
I dropped the ball with scanf.  :-(

> attached the correction, if anyone cares.  Nobody did half a year ago.

Your patch is out of date.  Also, construct such as

> +#define isascii(c)  ({ int __c = c; __c > 0 && __c <= 0x7f; })

are not portable, as blocks are not expressions and have no value.
But you could use inline functions if available.

Manuel



More information about the uClibc mailing list