Mailing List Archive


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

[tlug] compilation warnings for unsigned char



G'day all,

I hope you experts can help; I've done a lot of RTFMing but got nowhere.

I'm trying to crank out a bug-fix version of my 14yo xjdic program.
It's close to turning loose, but I'd like to tidy up a squillion
compilation warnings that have only now appeared.

Background:

xjdic handles all its text in unsigned char strings. They have to
be unsigned or comparisons don't work. Strings get moved around
by things like strcpy, strncpy, strcat, etc. All works well.

Problem:

With my latest distro (FDC4) the gcc (version 4.0.2 20051125 (Red Hat
4.0.2-8))  spews out warnings for every strcpy, strcat, etc. E.g.

xjdserver.c:228: warning: pointer targets in passing argument 1 of
'strcpy' differ in signedness
xjdserver.c:228: warning: pointer targets in passing argument 2 of
'strcpy' differ in signedness

Now in that case, both arguments are "unsigned char", so I assume
the warning is because strcpy's prototype says it should be "char".

Putting -funsigned-char as a gcc option makes no difference.

Can anyone suggest a solution/workaround? I don't want to move
to memcpy(target,source,strlen(source)) or something like that, but It
would be good to get rid of those rather useless warnings.

Cheers

Jim

-- 
Jim Breen                                http://www.csse.monash.edu.au/~jwb/
Clayton School of Information Technology,               Tel: +61 3 9905 9554
Monash University, VIC 3800, Australia                  Fax: +61 3 9905 5146
(Monash Provider No. 00008C)                ジム・ブリーン@モナシュ大蛙触Â


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links