sonar c++ plugin parser error - c++

I have a project which contains one cpp file and included few header files. Sonar squid sensor complains about parser error in the file, and I am getting the parser error messages in the output log with INFO statements.
After this when I get the number of lines of code from Decorator context of sonar it is giving me 1 line.
How can i make sure to skip the parser error, i tried
sonar.cxx.errorRecoveryEnabled=true
But still the error is displayed in log and i am getting the total lines as 1.
When ever there is a parser error in the files i am getting the value NCLOC = 1.0

Related

VSCode does not show errors in C/C++ before saving

VSCode won't show me error in C++ unless I save the file or do Command Pallete -> C/C++: Run Code Analysis on Active File.
It works properly in JS and Python, so I am 100% sure that it is a language-specific problem.
For example in Python/JS
Shows me error immediately
in C/C++
Error does not show up
Error shows up only after I save/run code analysis
I turned error squiggles on and checked IntelliSense settings more than 100 times.

Prevent logging of File not found exceptions

Hi am getting a lot of errors in the coldfusion exception log from bots trying to access files that no longer exists. Below an example:
"Error","ajp-nio-****","12/08/21","11:21:21","****","File not found: **** The specific sequence of files included or processed is: ****'' "
coldfusion.runtime.TemplateNotFoundException: File not found: ***
Is there a way to prevent coldfusion from logging TemplateNotFoundException's in it's exceptions logs?

rmarkdown error: "myfile.tex"' had status 1

I am trying to compile an RMarkdown document from an R script. This is the code I am running:
setwd("C:/Users/me/me_VN02_5676/myfolder")
rmarkdown::render("myrmd.Rmd",
output_file = "mypdf.pdf")
This results in the error:
Error: Failed to compile mypdf.tex.
In addition: Warning message:
running command '"pdflatex" -halt-on-error -interaction=batchmode "mypdf.tex"' had status 1
Does anyone know what is happening?
Additional Notes
The PDF file is created when I use the Knit button in RStudio
This code does produce the .Tex file and when I run that it produces the pdf but render() does not produce the pdf
When I run the .R file via the command line it works! The PDF is created but why doesn't it work in R studio?
It would help to provide a Minimal Working Example so that we can attempt to replicate the problem. However, there may be two potential causes:
File Paths Look Incorrect
In R, they should be specified with a single forward slash: https://stat.ethz.ch/R-manual/R-devel/library/base/html/file.path.html
setwd("C:/Users/me/me_VN02_5676/myfolder")
rmarkdown::render("myrmd.Rmd",
output_file = paste0("mypdf.pdf")
)
PDF Output File May be Open
Another potential cause of this is that the PDF file is open, and therefore pandoc cannot save the output PDF. Try closing the PDF and render the document again.
Link to previous issue in Knitr which relates to this: https://github.com/yihui/knitr/issues/1209

How to continue execution of fabricate based software when error is encountered

There is a tool which uses fabricate makefile and saxon as XSLT processor to run and build xslt based project. The program is executed using a main python script which executes several files. I have an issue that the python script is stopping when an error is encountered (for example if there is a syntax error in xsl template file, the error comes on screen and execution is stopped). I want the file to execute even when there is an error and log the error into file. I know how to log error into file but i dont know how to continue the execution of program even when error is encountered. Please answer to this question with example because it will be difficult to understand only theory.

Failing to use PGO with error LNK1270

I'm trying to use Profile Guided Optimization (PGO) with VS8. After instrumenting the DLL in question I copy it over to a machine that has our application installed and run the training scenario. I then copy the pgc training files back to my dev box and get the following error:
1>StdAfx.obj : fatal error LNK1270: invalid file; timestamp does not match file linked with /LTCG:PGINSTRUMENT
The MSDN entry for this error says:
invalid file; timestamp does not match file linked with /LTCG:PGINSTRUMENT
The same files passed to the linker when specifying /LTCG:PGINSTRUMENT must also be passed when specifying /LTCG:PGOPTIMIZE.
/LTCG:PGOPTIMIZE requires that the inputs be identical to the /LTCG:PGINSTRUMENT phase.
To resolve this warning, run /LTCG:PGINSTRUMENT, redo all test runs, and run /LTCG:PGOPTIMIZE, or, create the optimized image with /LTCG:PGUPDATE instead of /LTCG:PGOPTIMIZE.
Rerunning the tests doesn't solve the problem (although it sometimes appears for other files, not stdafx.obj).
Using /LTCG:PGUPDATE does work however I would like to understand what is causing the error, or failing that are there any drawbacks to using PGUPDATE rather than PGOPTIMIZE (I can't find anything relevant in the MSDN PGO page).