Signedness of char and puts()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following code produces 2 warnings with gcc 4.1.1:

signed char * mystring = "Hello";                       
puts (mystring);

warning: pointer targets in initialization differ in signedness
warning: pointer targets in passing argument 1 of 'puts' differ in signedness

Modifying the code as shown below corrects the problem:

char * mystring = "Hello";

The same warnings occur is the char is declared unsigned.

Does anyone know why this occurs?  

Thank you.            

 




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux