Omar9027 / ratproxy

Automatically exported from code.google.com/p/ratproxy
0 stars 0 forks source link

lot of sigdness warnings #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This seems to be a bad practise. All sigdness warnings and using
-Wno-pointer-sign to avoid them. It would be great if they are fixed. And
the easiest way to fix them for the time being could be using wrapper
macros around calling to functions with pointer conversion. This is a bad
fix but looking at the number of warnings, it could remove them.

Original issue reported on code.google.com by rakesh.p...@gmail.com on 8 Nov 2008 at 3:44

Attachments:

GoogleCodeExporter commented 9 years ago
yes I think you are right.

Original comment by wuchunfang2006 on 6 Oct 2009 at 7:22

GoogleCodeExporter commented 9 years ago
I am not entirely sure why this would be a bad practice: the programmer might 
opt to
have a precise control over the size and signedness of all internal variables
specifically to avoid implementation errors (so that "if (some_char > 0) ..." or
"while ((some_char--) >= 0) ..." behaves the same way on all platforms), and I 
think
gcc is a bit overzealous here. 

I wish there was a simple option to silence just the warnings that seem to be
misguided (complaining about implicit unsigned char* to signed char* casts when
calling libc functions), but as far as I know, there isn't one. Adding macros or
explicit casts seems like an overkill.

If you have an elegant solution, let me know - otherwise, I'm marking this as 
WontFix.

Original comment by lcam...@gmail.com on 6 Oct 2009 at 7:49