This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/23087] New: Misleading warning, "... differ in signedness"
- From: "kst at mib dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Jul 2005 19:56:21 -0000
- Subject: [Bug c/23087] New: Misleading warning, "... differ in signedness"
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
% cat tmp.c
void foo(void)
{
signed char *ps = "signed?";
unsigned char *pu = "unsigned?";
}
% gcc --version
gcc (GCC) 4.0.0
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% gcc -c tmp.c
tmp.c: In function 'foo':
tmp.c:3: warning: pointer targets in initialization differ in signedness
tmp.c:4: warning: pointer targets in initialization differ in signedness
Plain char is either signed or unsigned, depending on the system configuration.
Both initializations call for warnings, since plain char is a distinct type
from both signed char and unsigned char, but in one of the two cases it
doesn't actually "differ in signedness".
--
Summary: Misleading warning, "... differ in signedness"
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kst at mib dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: sparc-sun-solaris2.9
GCC host triplet: sparc-sun-solaris2.9
GCC target triplet: sparc-sun-solaris2.9
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23087