Open mingodad opened 9 months ago
I finished my MVP and the output matches the clang
output (gcc
too although gcc
uses one space and clang
uses two to at the beginning of each filename dependency) see here https://github.com/robertoraggi/cplusplus/pull/313 .
This is my first step on a more ambitious feature that would dump each included file and show some stats about the context about it:
The idea is also to check if a giving file is attempted to be included more that once globally and if it has #pragma once
or guard macro
and the external referenced macro values have changed since it's first inclusion emit a warning/error .
To help debug I propose to add
-M
and-MM
command line options, I already got an MVP partially working (it's missing extract the filename without path and extension to use as root dependency likesrc/test.cpp
->test.o
and check the last entry in the loop to omit the line continuation), see bellow .Or maybe drop the line continuation and root dependency and simple dump the filenames.