Click here to Skip to main content
15,897,704 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
Greg Utas13-May-20 2:54
professionalGreg Utas13-May-20 2:54 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
Greg Utas13-May-20 3:09
professionalGreg Utas13-May-20 3:09 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
Stuart Dootson13-May-20 3:22
professionalStuart Dootson13-May-20 3:22 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
kalberts13-May-20 3:51
kalberts13-May-20 3:51 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
Stuart Dootson13-May-20 4:47
professionalStuart Dootson13-May-20 4:47 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
kalberts13-May-20 5:25
kalberts13-May-20 5:25 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
User 4041113-May-20 20:41
User 4041113-May-20 20:41 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
Greg Utas14-May-20 0:17
professionalGreg Utas14-May-20 0:17 
I did try PVS-Studio, and here[^] is a post about what I changed as a result of its findings. It provides a one-week free trial, after which you have to pay. I didn't see anything for open-source projects, and an email inquiring about pricing has gone unanswered.

Trying out Deep Code led to these[^] changes.

And there's one that I wrote: A Static Analysis Tool for C++[^].

I'm now going through Coverity's findings. The majority of them flag destructors for calling things that can throw. I don't know whether I'll fix these, because I catch the ensuing SIGABRT and prevent the program from exiting. However, this has occasionally led to a SIGABRT loop, which is worse than exiting. So I also have code that checks the stack for a destructor or delete operator before throwing. But a non-throwing version of a few things could be an improvement.

Coverity is good at analyzing execution paths, so besides these destructor things it tells you stuff like
  • You already checked this for nullptr, so why are you checking it again?
  • You're checking this for nullptr now, so why didn't you bother when you first used it?
  • You're using an array index that could be out of bounds because it was returned by so-and-so function.
Naturally there are false positives, but I'd rather see them than not. A common one is that my parser will get the pointer from a unique_ptr, which then assigns ownership to another unique_ptr, after which I access the object through the original pointer. This gets flagged.

GeneralMessage Closed Pin
14-May-20 0:25
User 4041114-May-20 0:25 
GeneralRe: Coverity Scan for Visual Studio / C++ Pin
Greg Utas14-May-20 0:33
professionalGreg Utas14-May-20 0:33 
GeneralSo I am a little depressed by my COVID lockdown weight gain... PinPopular
DRHuff12-May-20 5:47
DRHuff12-May-20 5:47 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
den2k8812-May-20 5:51
professionalden2k8812-May-20 5:51 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
Mike Hankey12-May-20 6:13
mveMike Hankey12-May-20 6:13 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
lopatir12-May-20 7:08
lopatir12-May-20 7:08 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
Mike Hankey12-May-20 7:19
mveMike Hankey12-May-20 7:19 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
lopatir12-May-20 7:24
lopatir12-May-20 7:24 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
Mike Hankey12-May-20 7:59
mveMike Hankey12-May-20 7:59 
GeneralRe: So I am a little depressed by my COVID lockdown weight gain... Pin
Slacker00712-May-20 6:32
professionalSlacker00712-May-20 6:32 
JokeRe: So I am a little depressed by my COVID lockdown weight gain... Pin
PIEBALDconsult12-May-20 12:27
mvePIEBALDconsult12-May-20 12:27 
GeneralThought of the Day Pin
OriginalGriff12-May-20 4:46
mveOriginalGriff12-May-20 4:46 
GeneralRe: Thought of the Day Pin
Tim Deveaux12-May-20 4:49
Tim Deveaux12-May-20 4:49 
GeneralRe: Thought of the Day Pin
Mike Hankey12-May-20 4:49
mveMike Hankey12-May-20 4:49 
GeneralRe: Thought of the Day Pin
Daniel Pfeffer12-May-20 4:57
professionalDaniel Pfeffer12-May-20 4:57 
GeneralRe: Thought of the Day Pin
DRHuff12-May-20 5:05
DRHuff12-May-20 5:05 
GeneralRe: Thought of the Day Pin
ZurdoDev12-May-20 5:13
professionalZurdoDev12-May-20 5:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Straw Poll

Were you affected by the geomagnetic storms this past weekend?
Communication disruptions, electrified pipes, random unexplained blue-screens in Windows - the list of effects is terrifying.
  Results   296 votes