<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - scan-build always reports No bugs found"
   href="https://bugs.llvm.org/show_bug.cgi?id=37268">37268</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>scan-build always reports No bugs found
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>other
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dcoughlin@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>benny.kj@gadgeon.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>I'm trying to get scan-build working with IAR C/C++ Compiler but scan-build
always reports No bugs found.

I have performed the below steps.

1. On Windows 10 64 bit, Downloaded and installed
<a href="http://releases.llvm.org/6.0.0/LLVM-6.0.0-win64.exe">http://releases.llvm.org/6.0.0/LLVM-6.0.0-win64.exe</a>

2. Installed strawberry-perl-5.26.2.1-64bit.msi

3. Ran the below command

scan-build  -v -v -v -o .\test --keep-empty --use-analyzer
c:\LLVM\bin\clang.exe --use-cc "c:\Program Files (x86)\IAR Systems\Embedded
Workbench 8.0\avr\bin\iccavr.exe" -enable-checker alpha.core.PointerArithm
"c:\Program Files (x86)\IAR Systems\Embedded Workbench
8.0\common\bin\IarBuild.exe" "IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.ewp" -build Debug -log all

4. I've also tried without the -enable-checker alpha.core.PointerArithm and the
result is still No bugs found.

5. A directory by the name 2018-04-27-181923-2936-1 or similar name is getting
created every time but has no contents.

Kindly suggest how to debug further.



Please find the detailed log below:
=========================
Log
=========================

C:\Users\benny\Documents>scan-build  -v -v -v -o .\test --keep-empty
--use-analyzer c:\LLVM\bin\clang.exe --use-cc "c:\Program Files (x86)\IAR
Systems\Embedded Workbench 8.0\avr\bin\iccavr.exe" -enable-checker
alpha.core.PointerArithm "c:\Program Files (x86)\IAR Systems\Embedded Workbench
8.0\common\bin\IarBuild.exe" "IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.ewp" -build Debug -log all

C:\Users\benny\Documents>perl -S scan-build -V -v -v -v -o .\test --keep-empty
--use-analyzer c:\LLVM\bin\clang.exe --use-cc "c:\Program Files (x86)\IAR
Systems\Embedded Workbench 8.0\avr\bin\iccavr.exe" -enable-checker
alpha.core.PointerArithm "c:\Program Files (x86)\IAR Systems\Embedded Workbench
8.0\common\bin\IarBuild.exe" "IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.ewp" -build Debug -log all
scan-build: Using 'c:\LLVM\bin\clang.exe' for static analysis
scan-build: Emitting reports for this run to
'C:/Users/benny/Documents/test/2018-04-27-182051-7560-1'.

     IAR Command Line Build Utility V8.0.7.4869
     Copyright 2002-2017 IAR Systems AB.

Building configuration: ledchaser - Debug
Updating build tree...
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\Debug\Obj\ledchaser.r90
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\Debug\Exe\ledchaser.d90

2  file(s) deleted.
Updating build tree...

ledchaser.c
iccavr.exe C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.c --cpu=m48 -ms -o
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\Debug\Obj --initializers_in_flash --no_cse
--no_inline --no_code_motion --no_cross_call --no_clustering --no_tbaa --debug
-e --eeprom_size 256 --dlib --dlib_config c:/Program Files (x86)\IAR
Systems\Embedded Workbench 8.0\avr\LIB\DLIB\dlAVR-1s-ec_mul-n.h -Ol

   IAR C/C++ Compiler V7.10.1.1197 for Atmel AVR
   Copyright 1996-2017 IAR Systems AB.
   Evaluation license - IAR Embedded Workbench for Atmel AVR, Evaluation
Version 7.10
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\ledchaser.c(52) : Warning[Pe550]: variable
"p" was set but never used

 52 bytes of CODE memory
  0 bytes of DATA memory (+ 2 bytes shared)

Errors: none
Warnings: 1

Linking
xlink.exe C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\Debug\Obj\ledchaser.r90 -o
C:\Users\benny\Documents\IAR Embedded
Workbench\avr\examples\IAR\STK500\Debug\Exe\ledchaser.d90 -Ic:/Program Files
(x86)\IAR Systems\Embedded Workbench 8.0\avr\LIB\ -f c:/Program Files (x86)\IAR
Systems\Embedded Workbench 8.0\avr\src\template\cfgm48.xcl -D_..X_HEAP_SIZE=0
-D_..X_TINY_HEAP_SIZE=0 -D_..X_NEAR_HEAP_SIZE=20 -D_..X_FAR_HEAP_SIZE=0
-D_..X_HUGE_HEAP_SIZE=0 -D_..X_CSTACK_SIZE=20 -D_..X_RSTACK_SIZE=20
-D_..X_FLASH_CODE_END=_..X_FLASH_END -f c:/Program Files (x86)\IAR
Systems\Embedded Workbench 8.0\avr\src\template\cfg1soim.xcl
-D_..X_FLASH_BASE=_..X_INTVEC_SIZE -H1895 -h(CODE)0-(_..X_INTVEC_SIZE-1)
-D_..X_CSTACK_BASE=_..X_SRAM_BASE -D_..X_CSTACK_END=_..X_SRAM_END
-D_..X_RSTACK_BASE=_..X_SRAM_BASE -D_..X_RSTACK_END=_..X_SRAM_END -rt -s
__program_start c:/Program Files (x86)\IAR Systems\Embedded Workbench
8.0\avr\LIB\DLIB\dlAVR-1s-ec_mul-n.r90 -e_PrintfSmall=_Printf
-e_ScanfFull=_Scanf

     IAR Universal Linker V6.5.0.91
     Copyright 1987-2016 IAR Systems AB.

 108 bytes of CODE memory (+            50 range fill )
  64 bytes of DATA memory (+ 2 absolute )

Errors: none
Warnings: none


Total number of errors: 0
Total number of warnings: 1

scan-build: No bugs found.


=======================================================
Source File
=======================================================
void test1();
void test2();
int main( void ) 
{

    test1();
    test2();
    while(1)        /* Eternal loop */
    {
    }

}
void test1() {
  int x;
  int *p;
  p = &x + 1; // warn
}

void test2() {
  void (*foo)(void);
  foo = 0;
  foo(); // warn: function pointer is null
}</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>