On Sat, Jan 8, 2022 at 1:15 PM Petro Karashchenko <
petro.karashche...@gmail.com> wrote:

> Hi,
>
> What about inline functions? Those are also a part on C99.
>
>
Change to normal function or macro.


> Are those old architectures checked by the CI?


Not all, arm/mips/risc-v/sim/x86/x86_64/xensa/renesas is enabled in CI,
avr/ceva/hc/misoc/or1k/z16/z80 not:
https://github.com/apache/incubator-nuttx/tree/master/tools/ci/testlist/all.dat



> I mean do we have a proof
> that those are still compilable with the latest release?
>
> Best regards,
> Petro
>
> On Sat, Jan 8, 2022, 6:37 AM Xiang Xiao <xiaoxiang781...@gmail.com> wrote:
>
> >
> >
> > On Sat, Jan 8, 2022 at 6:29 AM Petro Karashchenko <
> > petro.karashche...@gmail.com> wrote:
> >
> >> Hello team,
> >>
> >> Recently I mr. @Xiang Xiao <xiaoxiang781...@gmail.com> had a discussion
> >> in one of the PR's related to C89 code compliance. Particularly related
> to
> >> initializing a structure by field names (designated initializers). Mr.
> @Xiang
> >> Xiao <xiaoxiang781...@gmail.com> pointed out that "for the common code
> >> it is better to avoid C99 only features".
> >> I examined the current NuttX code and see that currently common code is
> >> far away from C89 already and things like "<stdbool.h>", "<inttypes.h>",
> >> "snprintf", "designated initializers", "__VA_ARGS__" (variadic macro)
> are
> >> deeply embedded into the code.
> >>
> >>
> > We need separate the features that come from the compiler and the
> standard
> > library. Since the libc is provided by NuttX self:
> >
> >    1. The header files(e.g.stdbool.h, intttyes.h) and function(e.g.
> >    snprintf) can be used in common code since NuttX can provide the
> >    implementation for all arch even the arch use a very old compiler
> >    2. The preprocessor (e.g.  __VA_ARGS__) or language( designated
> >    initializers) feature need to avoid or incorporate into the
> conditional
> >    macro
> >
> > .
> >
> >> I would like to come up with the suggestion to make C99 as a
> prerequisite
> >> for the compiler that is used to build NuttX code.
> >>
> >
> > As Greg said, if compilers used on all arch supported by NuttX support
> > C99, there is no reason to limit us to C89. The compiler status is a
> > keypoint.
> >
> >
> >>
> >> Best regards,
> >> Petro
> >>
> >>
>

Reply via email to