Re: Move to C99 for common code

2022-01-08 Thread Nathan Hartman
On Sat, Jan 8, 2022 at 11:34 AM Alan Carvalho de Assis wrote: > I agree! There are few places where designated initializer list are used in > the common code (in arch/ and boards/ they can be used without further > concern), so it can be fixed at no time. > > In the other hand this flexibility is

Re: Move to C99 for common code

2022-01-08 Thread Gregory Nutt
> Also consider SH1 > And M16C

Re: Move to C99 for common code

2022-01-08 Thread Alan Carvalho de Assis
I agree! There are few places where designated initializer list are used in the common code (in arch/ and boards/ they can be used without further concern), so it can be fixed at no time. In the other hand this flexibility is the root causes for confusion, mainly for new contributors. It does appe

Re: Move to C99 for common code

2022-01-08 Thread Petro Karashchenko
I do not think that code duplication is a good idea. I'd better search common code for designated initializer list and rework it (remove) to get back C89 style. Best regards, Petro On Sat, Jan 8, 2022, 3:54 PM Alin Jerpelea wrote: > that code duplication is the way I was thinking if we want to

Re: Move to C99 for common code

2022-01-08 Thread Petro Karashchenko
When talking about inline I'm referring to "static inline" functions like in https://github.com/apache/incubator-nuttx/blob/c55085c0d8864c9401de97872ab3463d474f262c/include/nuttx/mutex.h and not to "inline_function" define from compiler.h. At least I do not find "#define inline" (to empty) in compi

Re: Move to C99 for common code

2022-01-08 Thread Alan Carvalho de Assis
Yes, now I remember the reason to it has been removed. BTW, I think 6502 will face same issue because the stack point is only 8-bits (it will be limited to 256 bytes), correct? On 1/8/22, Gregory Nutt wrote: > Support for the 8051 was removed for other reasons... that family has a > very small h

Re: Move to C99 for common code

2022-01-08 Thread Gregory Nutt
Support for the 8051 was removed for other reasons... that family has a very small hardware stack that had to be saved and restored on each context switch. That provided bigtime compatibility issues with other architectures. That combined with the facts that (1) I never could get the 8051 running

Re: Move to C99 for common code

2022-01-08 Thread Alin Jerpelea
that code duplication is the way I was thinking if we want to be able to use both compilers and keep all platforms Best Regards Alin On Sat, 8 Jan 2022, 14:42 Alan Carvalho de Assis, wrote: > Hi Alin, > > using a menu option in this case will not work because the point is > not passing a std c99

Re: Move to C99 for common code

2022-01-08 Thread Alan Carvalho de Assis
Hi Tomasz, Currently NuttX doesn't support 6502 and even the support to 8051 was removed some years ago. BTW, I think it could be possible to support C99 for 6502 if you use gcc: https://github.com/itszor/gcc-6502-bits BR, Alan On 1/8/22, Tomasz CEDRO wrote: > On Sat, Jan 8, 2022 at 1:53 PM G

Re: Move to C99 for common code

2022-01-08 Thread Alan Carvalho de Assis
Hi Alin, using a menu option in this case will not work because the point is not passing a std c99 flag to the compiler, but using some C99 features in the source code to simplify it. For example: the designated initializer list: struct test_s test = { .second = 2, .first = 1

Re: Move to C99 for common code

2022-01-08 Thread Tomasz CEDRO
On Sat, Jan 8, 2022 at 1:53 PM Gregory Nutt wrote: > z80 holds all 8-bit ZiLOG architectures. That means > > z80 using the SDCC compiler > z180 using the SDCC compiler > ez80 which normally uses the ZiLOG compiler, but there is an experimental > version of GCC for the ez80 > > z16 uses only ZiLOG

Re: Move to C99 for common code

2022-01-08 Thread Alin Jerpelea
In my opinion we should try to keep all platforms and avoid breaking them by adopting new standards An option would be to add the C99 as a menu option while keeping the current compilers compatibility Best Regards Alin On Sat, 8 Jan 2022, 13:53 Gregory Nutt, wrote: > z80 holds all 8-bit ZiLOG

Re: Move to C99 for common code

2022-01-08 Thread Alan Carvalho de Assis
According to SDCC page they have support to C99 and C11 see: http://sdcc.sourceforge.net Not sure if it applies to all MCU/CPU supported by the project. But I agree we cannot move to C99 if it means removing support to some architectures, we need to find a way to keep NuttX supporting them. BR,

Re: Move to C99 for common code

2022-01-08 Thread Gregory Nutt
Inline is not an issue. There is a file at include/nuttx/compiler.h that handles superficial differences between tools. If the compiler does not support inline, it is simply undefined. I have built ez80 using the ZiLOG tools fairly recently, but none of the others. It worked fine. On Fri, Jan

Re: Move to C99 for common code

2022-01-08 Thread Gregory Nutt
z80 holds all 8-bit ZiLOG architectures. That means z80 using the SDCC compiler z180 using the SDCC compiler ez80 which normally uses the ZiLOG compiler, but there is an experimental version of GCC for the ez80 z16 uses only ZiLOG compiler Also consider SH1 This will also require changes to IN