[Python-bugs-list] [ python-Bugs-544248 ] gcc warning in unicodeobject.c

SourceForge.net noreply@sourceforge.net
Mon, 07 Jul 2003 21:28:44 -0700


Bugs item #544248, was opened at 2002-04-15 09:29
Message generated for change (Comment added) made by bcannon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=544248&group_id=5470

Category: Build
Group: None
Status: Open
Resolution: None
Priority: 1
Submitted By: Walter Dörwald (doerwalter)
Assigned to: Nobody/Anonymous (nobody)
Summary: gcc warning in unicodeobject.c

Initial Comment:
gcc 2.96 on Linux (RedHat 7.1) issues the following 
warning when compiling Objects/unicodeobject.c 2.138 
(configured with --enable-unicode=ucs4)

Objects/unicodeobject.c: In function 
`PyUnicodeUCS4_Format':
Objects/unicodeobject.c:5574: warning: int format, 
long int 
arg (arg 3)
Objects/unicodeobject.c:5574: warning: unsigned int 
format, 
long unsigned int arg (arg 4)


----------------------------------------------------------------------

>Comment By: Brett Cannon (bcannon)
Date: 2003-07-07 21:28

Message:
Logged In: YES 
user_id=357491

Using gcc 3.1 on OS X I don't get any warnings.  Anyone still 
getting warnings?

----------------------------------------------------------------------

Comment By: Jeremy Hylton (jhylton)
Date: 2003-06-19 10:25

Message:
Logged In: YES 
user_id=31392

Any chance of progress here?


----------------------------------------------------------------------

Comment By: Walter Dörwald (doerwalter)
Date: 2002-09-18 12:22

Message:
Logged In: YES 
user_id=89016

If all relevant implementations of sprintf() support %lx I'd
say we should change PyString_FromFormatV(). But to decide
that, you should definitely ask on Python-dev.

----------------------------------------------------------------------

Comment By: Neal Norwitz (nnorwitz)
Date: 2002-09-13 06:47

Message:
Logged In: YES 
user_id=33168

Line is 6469 in current CVS.  I fixed the warning for arg 3,
arg 4 is a bit harder.  It requires using %lx which is not
supported in PyString_FromFormatV().  I'm not sure the
changes are worthwhile (that's why I didn't make the
change).  To fix PyString_FromFormatV(), these changes are
required:

Line 194:
-                       if (*f == 'l' && *(f+1) == 'd')
+                       if (*f == 'l' && (*(f+1) == 'd' ||
*(f+1) == 'x'))

Line: 266
-                       if (*f == 'l' && *(f+1) == 'd') {
+                       if (*f == 'l' && (*(f+1) == 'd' ||
*(f+1) == 'x')) {

Line: 287
-                               sprintf(s, "%x",
va_arg(vargs, int));
+                               if (longflag)
+                                       sprintf(s, "%lx",
va_arg(vargs, unsigned
 long));
+                               else
+                                       sprintf(s, "%x",
va_arg(vargs, unsigned)
);


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=544248&group_id=5470