On Wed, Sep 14, 2022 at 03:30:39PM +0200, Richard Biener via Gcc-patches wrote: > > +// GCC is distributed in the hope that it will be useful, but WITHOUT ANY > > +// WARRANTY; without even the implied warranty of MERCHANTABILITY or > > +// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License > > +// for more details. > > + > > +// You should have received a copy of the GNU General Public License > > +// along with GCC; see the file COPYING3. If not see > > +// <http://www.gnu.org/licenses/>. > > + > > +#include "rust-lex.h" > > + > > +#include "rust-system.h" // for rust_assert and rust_unreachable > > +#include "rust-diagnostics.h" // for rust_error_at > > +#include "rust-linemap.h" > > +#include "rust-session-manager.h" > > +#include "safe-ctype.h" > > just diving into a random patch here - I'm assuming I can take rust-lex.cc as > a boiler-plate example for the #include structure. > > In GCC all files should start with #including "config.h" followed by > "system.h" where _all_ system, including C++ standard library headers > should be pulled via system.h to allow working around OS and system > compiler issues. > > It might be that rust-system.h plays the role of config.h + system.h > but then the rust-lex.h include is before it. > > rust-codepoint.h including <string> is also problematic btw.
E.g. the Go FE has two parts, one very GCC specific that uses the explicit config.h + system.h etc. includes, the other is generic and there it includes go-system.h in every file first, where that starts with #include <config.h> various C++ standard includes #include <system.h> etc. Jakub