char* problems

Andrew Haley aph@redhat.com
Tue Sep 16 10:16:00 GMT 2008


Andrew Haley wrote:
> Douglas Gemignani wrote:
> 
>> I have serious issues when compiling using gcc 4.1.2, everytime i try
>> to pass a unsigned char* to a function that receives char*, i got
>> errors, it also happens when passing const char* to char* or unsigned
>> char* functions.
> 
> gcc 4.2 doesn't do that to me.  All I get (with -Wall) is

Correction: I meant 4.1.2

> pp.c:10: warning: pointer targets in passing argument 1 of 'foo' differ in signedness
> 
>> This is really annoying and the code is a working one in other system,
>> i would like to foce the compilation, i already tryed to use the
>> following flags:
>> -fno-const-strings
>> -Wwrite-strings
>> -funsigned-char
>>
>> but none of them worked.
>>
>> Is there something that i can tell to gcc, other than making casts all
>> over the code?
> 
> I can't duplicate your problem.
> Please give us more information: we need an example and the compiler
> options you used.
> 
> Andrew.



More information about the Gcc mailing list