List Info

Thread: signedness issues when compiling with -mno-powerpc




signedness issues when compiling with -mno-powerpc
user name
2006-07-19 21:39:04
I'm trying to compile libsa under powerpc with the options
-mno-power and
-mnopower-pc.  When these options are applied, lots of
things start complaining
about signedeness of pointers to char's.

One example is in libsa/checkpasswd.c line 121, where we
have:

char *passwd;
MD5Update(&md5ctx, passwd, strlen(passwd));

and according to the manpage: 
MD5Update(MD5_CTX *context, const unsigned char *data,
unsigned int len);

So what is the right fix for this?

My assumption is that each instance of this should be fixed
in the source.  Or
is there a compiler option I should use instead to skip past
these warnings?

---
Tim Rightnour <rootgarbled.net>
NetBSD: Free multi-architecture OS http://www.netbsd.org/
Genecys: Open Source 3D MMORPG: http://www.genecys.org/
signedness issues when compiling with -mno-powerpc
user name
2006-07-19 21:44:26
generally, those sorts of problems should be fixed in the
code.  if
it is too much of a nightmare, apply -Wno-pointer-sign to
that file
and note it in doc/HACKS (there is a big list already.)


.mrg.
signedness issues when compiling with -mno-powerpc
user name
2006-07-19 22:24:41
> char *passwd;
> MD5Update(&md5ctx, passwd, strlen(passwd));

> and according to the manpage: 
> MD5Update(MD5_CTX *context, const unsigned char *data,
unsigned int len);

> So what is the right fix for this?

In this particular case, I would say the right fix is to
make MD5Update
take a const void *.

More generally, I would say your assumption

> My assumption is that each instance of this should be
fixed in the
> source.

is right.

> Or is there a compiler option I should use instead to
skip past these
> warnings?

Check the docs; lots of warnings have -Wno-* forms.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouserodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3
27 4B
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )