Martin Olsson
2011-03-21 19:27:35 UTC
I'm working on webapp that tracks gcc warnings in a large C++ application.
I tried grepping the build log for "warning:" which works well for simple
single line warnings like "unused variable" etc. But g++ sometimes output
multiline warnings like this one:
file.h: In constructor ‘Blah::Blah()’:
file.h:2411: warning: ‘Blah::second’ will be initialized after
file.h:2406: warning: ‘SomeClass* Blah::first’
file.h:2413: warning: when initialized here
...this makes it a bit more complex to parse the build log correctly.
If I don't special-case the multiline warning it will get counted as
three warnings, which is not desirable in my case. Ideally, I don't
want to parse each kind of warning separately because there are quite
a lot of different warnings and new gcc versions might include new
kinds of warnings and warning formatting.
A) Can gcc output a machine readable build log (in XML or whatever)?
B) Is there a list of all warnings GCC can output somewhere?
Martin
I tried grepping the build log for "warning:" which works well for simple
single line warnings like "unused variable" etc. But g++ sometimes output
multiline warnings like this one:
file.h: In constructor ‘Blah::Blah()’:
file.h:2411: warning: ‘Blah::second’ will be initialized after
file.h:2406: warning: ‘SomeClass* Blah::first’
file.h:2413: warning: when initialized here
...this makes it a bit more complex to parse the build log correctly.
If I don't special-case the multiline warning it will get counted as
three warnings, which is not desirable in my case. Ideally, I don't
want to parse each kind of warning separately because there are quite
a lot of different warnings and new gcc versions might include new
kinds of warnings and warning formatting.
A) Can gcc output a machine readable build log (in XML or whatever)?
B) Is there a list of all warnings GCC can output somewhere?
Martin