[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: autodep8 test for C/C++ header



On Mon, Aug 07, 2023 at 09:17:18PM +0000, Benjamin Drung wrote:
> On Mon, 2023-08-07 at 22:52 +0300, Peter Pentchev wrote:
>...
> > 1) The library has a "main" header file that must be included before
> >    any of the others, and it does not come first in lexicographical
> >    order. It may define typedefs and structure definitions that
> >    the other header files can use, it may define preprocessor symbols
> >    that reflect the availability of this or that system header file or
> >    type; there are also other ways in which another header file
> >    distributed by the -dev package may depend on the main one.
> 
> In this case the non-"main" header could just include the "main" header
> as first step. Alternatively, an option to specify headers that should
> be included first could be added to the check script.
>...

The opposite problem also exists, where it is documented that only 
one/few "main" headers are supposed to be included directly by users
and the other headers are internal headers only to be included by
the "main" headers (or by other internal headers).

glibc and GNOME would be examples for this.

cu
Adrian


Reply to: