standardese / cppast

Library to parse and work with the C++ AST
Other
1.7k stars 164 forks source link

Preprocessor warnings printed with "errors" in provenance #140

Closed eyalroz closed 2 years ago

eyalroz commented 2 years ago

I'm running tool/cppast on a program of mine, never mind the exact cmdline, and I get:

[preprocessor] [warning] /path/to/src/execution_context.hpp:42: unknown warning group '-Wclass-memaccess', ignored [-Wunknown-warning-option]
[preprocessor] [error] /path/to/src//util/warning_suppression.hpp:18: note: expanded from macro 'DISABLE_WARNING'
[preprocessor] [error] /path/to/src//util/warning_suppression.hpp:15: note: expanded from macro 'DO_PRAGMA'
[preprocessor] [error] <scratch space>:126: note: expanded from here

The warning might be legit, but - the "note: expanded from macro" messages should:

  1. Not be printed as independent "items"
  2. Not be printed as errors

as they are simply part of the text for the initial warning.

Also the "scratch space" might be dropped, or otherwise made more informative.

foonathan commented 2 years ago

Thanks, they're now reported as "info" and the scratchspace one is hidden.