#130 character constant sign fix

closed-fixed
Borut Ražem
None
5
2009-03-23
2009-03-22
Robert Larice
No

sdcc per default treats chars as signed chars.
but unfortunately literal character constants 's' ...
are treated as unsigned chars.
furthermore the --funsigned-char commandline switch
should have effect on literal char constants,
but does not.
furthermore the CHAR_MAX and CHAR_MIN constants
in limits.h should change when --funsigned-char is
given.
and finally there is a library routine which
accidently uses CHAR_MAX instead of SCHAR_MAX

the attached patch tries to fix that,
introduces a new preprocessor token SDCC_CHAR_UNSIGNED
a regression test,
and add a stanca in the documentation.

rlar

Discussion

  • Robert Larice
    Robert Larice
    2009-03-22

     
    Attachments
  • Borut Ražem
    Borut Ražem
    2009-03-23

    • assigned_to: nobody --> borutr
    • status: open --> closed-fixed
     
  • Borut Ražem
    Borut Ražem
    2009-03-23

    Patch applied in svn revision #5421.
    Thanks, Robert!

    Borut