Re:Large single compilation-unit C programs (2006)
by gridlockd on Friday October 09, 2020 @06:55AM
(#24728665)
The preprocessor doesn't remove comments and at least in clang, comments are parsed into the AST.
[ Parent
| on HN ]
Re:Large single compilation-unit C programs (2006)
by dvfjsdhgfv on Friday October 09, 2020 @07:36AM
(#24728892)
Well, according to C99, it should. Section "5.1.1.2 Translation phases" says (in phase 3): "Each comment is replaced by one space character."
Edit: just checked and clang behaves just like gcc with -E. Maybe you didn't mean comments but preprocessor directives?
Re:Large single compilation-unit C programs (2006)
by tom_mellior on Friday October 09, 2020 @08:02AM
(#24729017)
Clang, like GCC, has -C and -CC flags to preserve comments during preprocessing. However, these are really flags for the underlying preprocessor. Your parent might be thinking of some application of the Clang frontend that does not run preprocessing. For example, clang-format will probably not want to preprocess the code nor strip out comments.