devctl.h missing extern C

Brian Inglis Brian.Inglis@SystematicSw.ab.ca
Thu Feb 13 21:28:00 GMT 2020


On 2020-02-10 09:10, Joel Sherrill wrote:

> I noticed devctl.h is missing extern C. Does newlib have rules
> on where they go? In stdio.h they were deeper in the file than
> my normal style.
> 
> Obviously, I will be following up shortly with a patch.

Many headers now include _ansi.h which defines _{BEGIN,END}_STD_C and use those:
at the start after the include guard and setup (conditional) feature tests and
sets, and includes, before any functional declarations or definitions; and at
the end before SSP features tests and includes.

Others may have a __cplusplus test right after the include guard test, before
the include guard symbol definition; and the closing brace right before the
guard endif; otherwise as with the macros above.

You can get a sense of the usage with:

$ egrep -C3 __cplusplus newlib/**/include/**/*.h
$ egrep -C3 '_ansi\.h|_(BEGIN|END)_STD_C' newlib/**/include/**/*.h

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.



More information about the Newlib mailing list