On Fri, 2013-03-15 at 10:57 +0100, [email protected] wrote:
> 
> We're using gcc-4.3.2 for power-pc which (to my surprise!) treats
> "char" as unsigned.

Why is that a surprise? It is a C compiler. In C, the 'char' type may be
signed or unsigned by default depending on the phase of the moon.

> When there are no more arguments to parse getopt_long returns -1,
> which in our case will be converted to 255. As a result, the
> comparison on line 159 never returns true and independent of the
> parameters the usage section will be displayed.
> 
> Attached you'll find a patch which solves the problem.

The getopt() function is defined to return an 'int'. Wouldn't it be
cleaner to use that type for the 'c' variable, instead of signed char?

-- 
David Woodhouse                            Open Source Technology Centre
[email protected]                              Intel Corporation

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
_______________________________________________
TrouSerS-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/trousers-tech

Reply via email to