[cfe-dev] scan-build on Windows

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Tue Apr 9 23:53:36 PDT 2019


I don't fully understand what's going on in your case, but could you try 
removing the "CC=" line from the makefile? 'Cause it's the whole point 
of scan-build that it injects the analyzer through CC, so it can't work 
if you immediately overwrite it back. I think normally makefiles only 
enforce their own CC if it's unset otherwise.

On 4/10/19 8:40 AM, Siddharth Shankar Swain wrote:
> Hi Artem,
>
> Couple of points to note here :-
>
> There are two things we are trying to do :-
>
> 1) Trying to run scan-build on Windows
> 2) Running scan-build in linux and generating HTML reports in report 
> directory
>
> _*We are just trying to run scan-build with normal makefile which 
> compiles and analyzes one test case.*_
>
> The problem in the first case is that when i run the normal scan-build 
> with build command like this :-
>
> C:\Users\sid>perl -S scan-build -o out-dir make
>
> scan-build: Not supported for windows. Exiting...
>
>
> For the second case our aim is to just run scan-build with build 
> command for one test case file which will be analyzed and reports will 
> be generated in the reports directory
>
> sid at sid-linux:/local/mnt/workspace/llvm/tools/clang/tools/scan-build/bin/scan-build 
> --use-analyzer=/local/mnt/workspace/llvm/build/bin/clang make
> scan-build: Using ' /local/mnt/workspace/llvm/build/bin/clang' for 
> static analysis
> /local/mnt/workspace/llvm/build/bin/../libexec/ccc-analyzer -o test1 
> test1.c
> test1.c:6:9: clang_sa_warning: Value stored to 'k' during its 
> initialization is never read [deadcode.DeadStores]
>     int k = *j;
>         ^   ~~
> test1.c:6:13: clang_sa_warning: Dereference of null pointer (loaded 
> from variable 'j') [core.NullDereference]
>     int k = *j;
>             ^~
> 2 warnings generated.
> scan-build: Removing directory 
> '/tmp/scan-build-2019-04-10-115314-8475-1' because it contains no reports.
> scan-build: No bugs found.
>
>
> It shows bugs in the cmd but doesn't generate HTML reports. What can 
> be the possible cause of it ? ( Note here the clang is the latest 
> version) Is there any dependency from scan-build side that it will 
> work with a particular version of clang ?
>
>
> Thanks,
>
> Siddharth
>
>
> On Wed, Apr 10, 2019 at 6:40 AM Artem Dergachev <noqnoqneo at gmail.com 
> <mailto:noqnoqneo at gmail.com>> wrote:
>
>     +Aaron because i think he uses scan-build on Windows more or less
>     successfully. I won't have time for setting up a Windows machine for
>     myself in the nearest future.
>
>     Could you tell us exactly what you're doing and what exactly does it
>     print to console, more in the spirit of
>     http://www.catb.org/~esr/faqs/smart-questions.html ?
>
>      > scan-build: Not supported for windows. Exiting...
>
>     Hmm, i don't see such string in the source code of scan-build,
>     neither
>     it looks like a standard Perl message.
>
>      >  don't install clang and related tools like scan-build in
>     /usr/bin i
>     am not able to generate reports ( HTML files )
>
>     Could you provide the exact command and its exact output? Normally
>     you
>     don't care where is everything installed because you simply
>     provide the
>     path to the analyzer with `--use-analyzer`.
>
>
>     On 4/8/19 12:26 PM, Siddharth Shankar Swain wrote:
>     > Hi Artem, Laszlo,
>     >
>     > There are couple of problems with scan-build :-
>     >
>     > 1) For Windows i get the following error while running
>     scan-build - "
>     >
>     > “scan-build: Not supported for windows. Exiting...”:
>     >
>     > 2) For Linux Also if i don't install clang and related tools like
>     > scan-build in /usr/bin i am not able to generate reports ( HTML
>     files
>     > ). Like i get the clang_sa_warnings in cmd but scan-build
>     removes the
>     > directory saying no bugs found.
>     >
>     > Note - I already set the CC and CXX  flags to the clang compiler
>     >
>     > Please let me know if there is any other changes i need to make
>     in the
>     > env variable.
>     >
>     > Thanks,
>     > Siddharth
>     >
>     >
>     >
>     > On Sat, Apr 6, 2019 at 5:28 AM Laszlo Nagy
>     > <rizsotto.mailinglist at gmail.com
>     <mailto:rizsotto.mailinglist at gmail.com>
>     > <mailto:rizsotto.mailinglist at gmail.com
>     <mailto:rizsotto.mailinglist at gmail.com>>> wrote:
>     >
>     >     Hi Siddharth,
>     >
>     >     alternativly you can try this
>     >     <https://github.com/rizsotto/scan-build>, it's written in
>     Python.
>     >
>     >     Regards,
>     >     Laszlo
>     >
>     >     On Sat, Apr 6, 2019 at 5:14 AM Artem Dergachev via cfe-dev
>     >     <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>     <mailto:cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>>>
>     wrote:
>     >
>     >         Hi,
>     >
>     >         I never tried it myself but i can try to help you with
>     >         specific problems
>     >         that you're having if you disclose them.
>     >
>     >         scan-build is a Perl script, it most likely requires having
>     >         Perl and a
>     >         few Perl modules installed and that's it.
>     >
>     >         On 4/5/19 4:25 AM, Siddharth Shankar Swain via cfe-dev
>     wrote:
>     >         > Hi all,
>     >         >
>     >         > Can anyone help in installing and running "scan-build" on
>     >         Windows ?
>     >         >
>     >         > Thanks,
>     >         > Siddharth
>     >         >
>     >         > _______________________________________________
>     >         > cfe-dev mailing list
>     >         > cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>     <mailto:cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>>
>     >         > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>     >
>     >         _______________________________________________
>     >         cfe-dev mailing list
>     > cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>
>     <mailto:cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>>
>     > https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>     >
>




More information about the cfe-dev mailing list