New submission from Alexander Riccio:
This is safe, but warns on /W4. In maybe_handle_shebang, an unsigned char* is
passed to find_BOM, which accepts a char*
(https://hg.python.org/cpython/file/tip/PC/launcher.c#l1139).
Without an explicit cast, this generates a warning:
10>..\PC\launcher.c(1139): warning C4057: 'function': 'char *' differs in
indirection to slightly different base types from 'unsigned char [256]'
for `bom = find_BOM(buffer);`
Similarly, assigning start to buffer generates warnings:
10>..\PC\launcher.c(1141): warning C4057: '=': 'char *' differs in indirection
to slightly different base types from 'unsigned char *'
for `start = buffer;`
10>..\PC\launcher.c(1148): warning C4057: '=': 'char *' differs in indirection
to slightly different base types from 'unsigned char *'
for `start = &buffer[bom->length];`
----------
components: Windows
messages: 256547
nosy: Alexander Riccio, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Find_BOM accepts a char*, but is passed an unsigned char*; and related
usage
type: compile error
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25889>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com