Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Erlo Haugen
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 After the change, the compiler will naturally catch assignment of negative values to char, check for loop bounds and things like that, right? Erlo -BEGIN PGP SIGNATURE- Version: GnuPG v1 iQEcBAEBAgAGBQJUNCc0AAoJEDhA0GICupPBcOgH/ReztUaXMU+N+wo

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Philipp Klaus Krause
On 07.10.2014 18:09, Richard Gray wrote: > If I can stick my oar in here... doesn't this make the "unsigned" > directive a bit redundant? If one expected 'C' to be a signed char as > in ANSI C, one would use the 'unsigned' directive in the code. There > is no 'signed' directive as far as I know? T

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Philipp Klaus Krause
On 07.10.2014 11:20, Kustaa Nyholm wrote: > A thought: > > Over the years I've come across both defaults in various compilers, > I wonder if we/you could easily find out what is the common > default in the compilers that support the same set of processors > as SDCC...maybe that would give a hint o

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Richard Gray
If I can stick my oar in here... doesn't this make the "unsigned" directive a bit redundant? If one expected 'C' to be a signed char as in ANSI C, one would use the 'unsigned' directive in the code. There is no 'signed' directive as far as I know? This would also cause code that works today to brea

Re: [Sdcc-user] STM32 code size

2014-10-07 Thread remi
no effence :) Is the subject line should say stm8 ? not 32 ... stm32 has already gcc ... Regards Le 2014-10-07 15:01, Ben Shi a écrit : > Glad to hear that. > > In my opinion, an efficient way to optimize the code size is to substitute > the standard libraries in c to in assembly, be

Re: [Sdcc-user] STM32 code size

2014-10-07 Thread Ben Shi
Glad to hear that. In my opinion, an efficient way to optimize the code size is to substitute the standard libraries in c to in assembly, besides more deep optimizations in the code generator. So I hope more users can donate their code, just like Krzysztof Nikiel's patch #246. ( http://sourcefo

Re: [Sdcc-user] STM32 code size

2014-10-07 Thread Ben Shi
Glad to hear that. In my opinion, an efficient way to optimize the code size is to substitute the standard libraries in c to in assembly, besides more deep optimizations in the code generator. So I hope more users can donate their code, just like Krzysztof Nikiel's patch #246. (http://sourcefor

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Alan Cox
> > 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? >From a standards perspective the code was already broken. Bu

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Kustaa Nyholm
A thought: Over the years I've come across both defaults in various compilers, I wonder if we/you could easily find out what is the common default in the compilers that support the same set of processors as SDCC...maybe that would give a hint on what to do. Personally I think it is a bug if a cod

Re: [Sdcc-user] Changing the default for char from signed char to unsigned char

2014-10-07 Thread Maarten Brock
> 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. >>