printf %lld != %ld when _NO_LONGLONG
J. Johnston
jjohnstn@cygnus.com
Mon Mar 12 14:12:00 GMT 2001
Alexandre Oliva wrote:
>
> I'd expect %lld to be handled like %ld if -DWANT_PRINTF_LONG_LONG is
> not defined, but it's handled like %d. This makes a lot of a
> difference in case sizeof (long long) == sizeof (long) > sizeof (int).
>
> How about this patch? Ok to install?
>
>
Alexandre,
Please add a comment in the code. Based on my mail reader, it appears there are tabs between the
#define keywords and the macro names (don't know why), except for your added QUADINT statement.
After making the minor change, please go ahead and install the patch.
-- Jeff J.
----------------------------------------------------------------------------------------------------
> Index: newlib/ChangeLog
> from Alexandre Oliva <aoliva@redhat.com>
>
> * libc/stdio/vfprintf.c (QUADINT) [_NO_LONGLONG]: Make it
> equivalent to LONGINT.
>
> Index: newlib/libc/stdio/vfprintf.c
> ===================================================================
> RCS file: /cvs/src/src/newlib/libc/stdio/vfprintf.c,v
> retrieving revision 1.9
> diff -u -p -r1.9 vfprintf.c
> --- newlib/libc/stdio/vfprintf.c 2001/01/23 19:49:09 1.9
> +++ newlib/libc/stdio/vfprintf.c 2001/03/11 10:38:19
> @@ -279,7 +279,11 @@ static int exponent _PARAMS((char *, int
> #define LADJUST 0x004 /* left adjustment */
> #define LONGDBL 0x008 /* long double */
> #define LONGINT 0x010 /* long integer */
> +#ifndef _NO_LONGLONG
> #define QUADINT 0x020 /* quad integer */
> +#else /* if _NO_LONGLONG */
> +#define QUADINT LONGINT
> +#endif
> #define SHORTINT 0x040 /* short integer */
> #define ZEROPAD 0x080 /* zero (as opposed to blank) pad */
> #define FPT 0x100 /* Floating point number */
>
> ----------------------------------------------------------------------------------------------------
>
> --
> Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
> Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
> CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
> Free Software Evangelist *Please* write to mailing lists, not to me
More information about the Newlib
mailing list