This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

printf %lld != %ld when _NO_LONGLONG


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?

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]