I'm using Keil uVision v5.29 and ARM compiler v6.13.1 (ArmClang). I was looking for a static code analyzer and found that Clang includes a static analyzer that is run with the --analyze option (see http://clang.llvm.org/docs/UsersManual.html). I added the --analyze option to my project's compiler command line (Options for Target -> C/C++ (AC6) -> Misc Controls) and it seems to work, at least partially. When I rebuild I get several new and appropriate compiler warnings that were not detected before. However, now the linking fails with "project.axf: error: L6007U: Could not recognize the format of file .\objects\project\sourcefile.o."
Does the Clang static analyzer work with Keil uVision, ArmClang, and ArmLink?
Is adding --analyze to the [Options for Target -> C/C++ (AC6) -> Misc Controls] field the proper way to invoke the static analyzer?
Why do I get linker error L6007U with the --analyze compiler option and is there a way to avoid this error while using the Clang static analyzer?
Hello, running the compiler with this option does not actually compile the source, all it does is perform the analysis (and then writes this output to the .o file that MDK has specified as the output file. However this is just a text file, not a real ELF object. Furthermore, no use of this output is made by Arm tools.For info on static analysis tools to use with MDK, seehttp://www.keil.com/arm/verificationtools/