C++ Logo

sg15

Advanced search

Re: Header units and dependency scanning

From: Daniel Ruoso <daniel_at_[hidden]>
Date: Fri, 10 Jun 2022 11:29:45 -0400
Em sex., 10 de jun. de 2022 às 10:36, Daniel Ruoso <daniel_at_[hidden]> escreveu:
> An importable header is a header where the state of the preprocessor
> at the point of inclusion is not meant to semantically change how the
> header should be translated, and where isolation from that state is
> desirable.

On second thought, this would actually be a good reason to turn system
C headers into importable headers with explicit preprocessor arguments
for how they should be translated.

Over the years I have seen many cases of confusion caused by half of
the translation units of a project setting, for instance, large file
support in 32bit builds, which would lead to very unamusing
consequences. A project being able to say "I parse the system headers
unambiguously in this single way" seems like a very powerful thing.

daniel

Received on 2022-06-10 15:29:56