% 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