classification
Title: Compiler warnings when using UCS4
Type: compile error Stage:
Components: Unicode Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: christian.heimes Nosy List: benjamin.peterson, christian.heimes, loewis
Priority: high Keywords: easy

Created on 2008-03-18 14:00 by benjamin.peterson, last changed 2008-04-07 03:08 by loewis. This issue is now closed.

Messages (7)
msg63913 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-03-18 14:00
Compiling Python with --enable-unicode=ucs4 yields some compiler
warnings for unicodeobject.c:
In file included from Objects/unicodeobject.c:7807:
Objects/stringlib/string_format.h: In function 'do_conversion':
Objects/stringlib/string_format.h:745: warning: format '%c' expects type
'int', but argument 3 has type 'Py_UNICODE'
In file included from Objects/unicodeobject.c:7807:
Objects/stringlib/string_format.h: In function 'do_conversion':
Objects/stringlib/string_format.h:745: warning: format '%c' expects type
'int', but argument 3 has type 'Py_UNICODE'
Objects/unicodeobject.c: In function 'PyUnicodeUCS4_Format':
Objects/unicodeobject.c:8603: warning: format '%c' expects type 'int',
but argument 3 has type 'Py_UNICODE'
Objects/unicodeobject.c: In function 'PyUnicodeUCS4_Format':
Objects/unicodeobject.c:8603: warning: format '%c' expects type 'int',
but argument 3 has type 'Py_UNICODE'
msg63914 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-03-18 14:27
What operating system/compiler? Both branches? What precise revisions?
msg63916 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-03-18 14:39
This is MacOS 10.4, Apple gcc 4.0.1, and revision 61518.
msg63918 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-03-18 14:48
There are similar warnings in formater_unicode.c:
In file included from Python/formatter_unicode.c:13:
Python/../Objects/stringlib/formatter.h: In function 'unicode__format__':
Python/../Objects/stringlib/formatter.h:789: warning: format '%c'
expects type 'int', but argument 3 has type 'Py_UNICODE'
In file included from Python/formatter_unicode.c:13:
Python/../Objects/stringlib/formatter.h: In function 'unicode__format__':
Python/../Objects/stringlib/formatter.h:789: warning: format '%c'
expects type 'int', but argument 3 has type 'Py_UNICODE'
msg64254 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2008-03-21 18:32
I'll check it out later. I haven't been testing UCS4 builds for more
than a month.
msg64655 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-03-28 22:51
This is because in UCS, Py_UNICODE is an unsigned long. In calls to
PyErr_Format, the format specifier %c (int, the UCS2 Py_UNICODE) is
given, so the compiler gives a warning.
msg65060 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2008-04-07 03:08
This is now fixed in r62199
History
Date User Action Args
2008-04-07 03:08:52loewissetstatus: open -> closed
resolution: fixed
messages: + msg65060
2008-03-28 22:51:51benjamin.petersonsetmessages: + msg64655
versions: - Python 3.0
2008-03-21 18:32:13christian.heimessetpriority: high
assignee: christian.heimes
messages: + msg64254
keywords: + easy
nosy: + christian.heimes
2008-03-18 14:48:51benjamin.petersonsetmessages: + msg63918
2008-03-18 14:39:06benjamin.petersonsetmessages: + msg63916
2008-03-18 14:27:13loewissetnosy: + loewis
messages: + msg63914
2008-03-18 14:00:11benjamin.petersoncreate