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]

Re: printf %lld != %ld when _NO_LONGLONG


On Mar 12, 2001, "J. Johnston" <jjohnstn@cygnus.com> wrote:

> 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.

Thanks, here's what I'm checking in:

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/13 09:41:52
@@ -279,7 +279,13 @@ 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 /* ifdef _NO_LONGLONG, make QUADINT equivalent to LONGINT, so
+	 that %lld behaves the same as %ld, not as %d, as expected if:
+	 sizeof (long long) = sizeof long > sizeof int  */
+#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]