Mailing List Archive


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

Re: [tlug] compilation warnings for unsigned char



On Thu, 06 Jul 2006 15:38:30 +1000 (EST)
Jim Breen <Jim.Breen@example.com> wrote:

> >> > 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".

> >> try: 
> >> 
> >>    strcpy((char)foo1,(char)foo2);

> Nah. That just gave me even more ugly warnings about converting pointers
> and the like.

What Jim meant was to cast your strings back to char *, he obviously
forgot the pointer though.
 strcpy((char *)dst, (char *)src);

Note that strcpy is evil though, better use strncpy/strlcpy.

Attachment: signature.asc
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links