Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiler warnings when using UCS4 #46641

Closed
benjaminp opened this issue Mar 18, 2008 · 7 comments
Closed

Compiler warnings when using UCS4 #46641

benjaminp opened this issue Mar 18, 2008 · 7 comments
Assignees
Labels
build The build process and cross-build easy topic-unicode

Comments

@benjaminp
Copy link
Contributor

BPO 2388
Nosy @loewis, @tiran, @benjaminp

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/tiran'
closed_at = <Date 2008-04-07.03:08:52.386>
created_at = <Date 2008-03-18.14:00:11.636>
labels = ['easy', 'build', 'expert-unicode']
title = 'Compiler warnings when using UCS4'
updated_at = <Date 2008-04-07.03:08:52.385>
user = 'https://github.com/benjaminp'

bugs.python.org fields:

activity = <Date 2008-04-07.03:08:52.385>
actor = 'loewis'
assignee = 'christian.heimes'
closed = True
closed_date = <Date 2008-04-07.03:08:52.386>
closer = 'loewis'
components = ['Unicode']
creation = <Date 2008-03-18.14:00:11.636>
creator = 'benjamin.peterson'
dependencies = []
files = []
hgrepos = []
issue_num = 2388
keywords = ['easy']
message_count = 7.0
messages = ['63913', '63914', '63916', '63918', '64254', '64655', '65060']
nosy_count = 3.0
nosy_names = ['loewis', 'christian.heimes', 'benjamin.peterson']
pr_nums = []
priority = 'high'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue2388'
versions = ['Python 2.6']

@benjaminp
Copy link
Contributor Author

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'

@benjaminp benjaminp added topic-unicode build The build process and cross-build labels Mar 18, 2008
@loewis
Copy link
Mannequin

loewis mannequin commented Mar 18, 2008

What operating system/compiler? Both branches? What precise revisions?

@benjaminp
Copy link
Contributor Author

This is MacOS 10.4, Apple gcc 4.0.1, and revision 61518.

@benjaminp
Copy link
Contributor Author

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'

@tiran
Copy link
Member

tiran commented Mar 21, 2008

I'll check it out later. I haven't been testing UCS4 builds for more
than a month.

@tiran tiran added the easy label Mar 21, 2008
@tiran tiran self-assigned this Mar 21, 2008
@benjaminp
Copy link
Contributor Author

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.

@loewis
Copy link
Mannequin

loewis mannequin commented Apr 7, 2008

This is now fixed in r62199

@loewis loewis mannequin closed this as completed Apr 7, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build The build process and cross-build easy topic-unicode
Projects
None yet
Development

No branches or pull requests

2 participants