In general yes, but my main point was that I saw designated initializer
list heavily used in drivers code that is intended to be common. Also there
are some C99 features like inline functions in common code.

So we need to make an effort and clean-up common code to get back C89
compatibility.

Best regards,
Petro


On Sun, Jan 9, 2022, 1:41 PM Alan Carvalho de Assis <acas...@gmail.com>
wrote:

> On 1/9/22, Nathan Hartman <hartman.nat...@gmail.com> wrote:
> > On Sat, Jan 8, 2022 at 11:34 AM Alan Carvalho de Assis <
> acas...@gmail.com>
> > 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 the root causes for confusion,
> >> mainly
> >> for new contributors. It does appear orthogonal that part of the code
> are
> >> using C99/C11 and part are using C89.
> >
> >
> >
> > Architecture-specific code can use whatever that architecture's compiler
> > supports and in some cases might even have to use special features or
> > syntax.
> >
> > The question is only about common code.
> >
> > Common code that must work on all architectures is what has to be C89.
>
> That is what I said, but the point is: if NuttX mix C99/C11 in some
> places in the source code tree and in other places it only accepts C89
> it creates confusion for people.
>
> All this discussion started when our colleague saw a designated
> initializer list commit coming in a PR and thought it was forbidden,
> but in fact it was legal because it was to arch/ directory.
>
> Following a single standard could avoid this kind of confusion, but
> unfortunately we cannot move to C99 or newer until we have compilers
> for old arch supported by NuttX. Also forcing C89 to arch/ and board/
> will require a huge effort to adapt those source code. So we have a
> dilemma/catch 22.
>
> BR,
>
> Alan
>

Reply via email to