[cfe-dev] #line in analyser output

Jordan Rose jordan_rose at apple.com
Mon Jul 7 09:33:50 PDT 2014


The plist diagnostic locations are deliberately not using #line numbers because they are intended for consumption by an IDE. If you had a (pre-preprocessed) file with #line markers in it, you wouldn't want those to screw up the plist display (and in Xcode's case, the nice arrows), especially if you no longer had the original file.

The HTML output, likewise, is built on top of being able to print the entire input file as HTML. Since Clang doesn't have any other representation of the source, it has to use the file you give it, i.e. the preprocessed file. (This is also why the HTML output cannot display cross-file issues, so it's already something we'd be willing to change.) For the text that describes the location of the bug, though, it could definitely make sense to honor #line. Clang's term for this is the "presumed location".

What is your desired output?
Jordan


On Jul 7, 2014, at 2:42 , Julien Tous <julien.tous at gmail.com> wrote:

> I am using the static-analyser through scan-build command on code that has already been preprocessed by an external tool.
> Although the stdout diagnostic uses the #line informations contained in the preprocessed source files, both the plist and html outputs don't.
> 
> I would very much like to get html reports on the user written code instead of the preprocessed one.
> 
> Here come the questions :
> 
> Is there an existing way to transform a plist report into an html report ?
> I could then output reports in plist, convert them using #lines information, transform them into an html report.
> 
> Are there other tools that render the plist files into a user friendly representation ?
> 
> Can someone help me to identify what is missing to directly handle the #line directive directly in the html report (i have a very limited knowledge of the toolchain right now), and comment on the difficulty of the task, and if it would make sense to integrate it ?
> 
> Thanks,
> Julien
> 
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list