On Mon, Oct 06, 2014 at 09:00:51PM +0200, Philipp Klaus Krause wrote:
> Currently, in sdcc, char is signed char by default.
> 
> I would like to change this to unsigned char.
> 
> The current --funsigned-char would be replaced by a --fsigned char
> switch to get the non-default behaviour.
> 
> char being unsigned char by default has advantages:
> 
> People compare chars. For many architectures, unsigned comparisons are
> more efficient than unsigned comparisons.
> 
> People cast chars to ints (many standard functions int arguments for
> characters). Casts from unsigned char to int are muh more efficient than
> signed char to int (the latter needs sign extension, the former doesn't).
> 
> The C standard states that char should be either signed char or unsigned
> char.

  The only concern I have is backward-compability. I mean if someone's
program relies the default sign char, will this change breaks his code?

BR,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Homepage: http://people.cs.nctu.edu.tw/~chenwj

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to