3 ms·
To be fair here, NASA does say to avoid nesting headers. But then it follows up with this ridiculous statement: In extreme cases, where a large number of hea
by apaprocki 15y ago
To be fair here, NASA does say to avoid nesting headers. But then it follows up with this ridiculous statement:
In extreme cases, where a large number of header files are
to be included in several different source files, it is
acceptable to put all common #includes in one include file.
I would not trust anything else the author of that guide writes. EMBOSS says not to nest. The Atacama code suggests not nesting but then says:
To avoid nested includes, use #define wrappers as follows:
The last pdf states:
This prevents including the same item more than once when
a .c file includes several .h files (we rejected
alternatives involving conditional compilation as too
complicated).
I guess it boils down to preference since the language allows you to do either, I just don't put a lot of stock in these style guides.