[PATCH] eng: Clarify use of extern "C"

Joel Sherrill joel at rtems.org
Mon Jan 23 15:04:46 UTC 2023


On Mon, Jan 23, 2023 at 8:51 AM Sebastian Huber <
sebastian.huber at embedded-brains.de> wrote:

> On 23.01.23 15:01, Joel Sherrill wrote:
> > Following that comment precisely means we should remove them if there
> > are no functions. That ignores data items and the simple maintenance
> > issue of not having an extern C, adding something in the future and
> > forgetting to add extern C.
> >
> > IMO it's just part of the header file template we should always use.
> > Deciding when it is absolutely not needed is going to introduce latent
> > issues.
> So, you prefer to use the template (including header guards) also for
> files with just comments?
>

Are you referring to something like a Doxygen @mainpage which is never
intended to have code? I'm ok leaving it out of that case.

If the file has code (defines, etc) or if there is any chance the  file
will have it
added, then yes. I think it is best to follow the pattern. We all have come
back
and added something without realizing it needed to be added.

I would like to just future proof the header.

--joel

>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber at embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20230123/bfa6d93b/attachment.htm>


More information about the devel mailing list