Coding Convention: Sorting Order of Includes?

Joel Sherrill joel at rtems.org
Fri Jan 3 17:04:54 UTC 2020


On Fri, Jan 3, 2020, 10:53 AM Gedare Bloom <gedare at rtems.org> wrote:

> Hello all,
>
> Vijay noted in another thread that:
> "For RTEMS, I don't see any preference mentioned in the docs for the
> order or includes:
> https://docs.rtems.org/branches/master/eng/coding-conventions.html
>
> In libbsd, however, the FreeBSD style guide is followed which has a
> preference for the order of header includes:
> https://www.freebsd.org/cgi/man.cgi?query=style&apropos=0&sektion=9"
>
> Should we consider any rules? I would suspect that at least ordering
> by API layering could be helpful. Lexical sorting is nice but probably
> there will be some exceptions based on dependencies.
>

Those look pretty good as rules. I try to alphabetize headers but you
are right, sometimes it isn't possible. I'd be ok if this was added to our
style.

The linked page mentions how they do the beginning of a license block with
/*- so a program they have recovnizes it as a license but indent doesn't
like that so use /** when you need indent. They don't mention that /**
turns it into a Doxygen comment which creates another problem. We may want
to discuss doing something on these blocks. Personally I'd like to see
licenses start to change and spdx tags added even if the license can't
change.


> Gedare
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20200103/a485267d/attachment.html>


More information about the devel mailing list