Click here to Skip to main content
15,881,803 members

The Insider News

   

The Insider News is for breaking IT and Software development news. Post your news, your alerts and your inside scoops. This is an IT news-only forum - all off-topic, non-news posts will be removed. If you wish to ask a programming question please post it here.

Get The Daily Insider direct to your mailbox every day. Subscribe now!

 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Greg Utas20-Mar-20 6:17
professionalGreg Utas20-Mar-20 6:17 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
ZurdoDev20-Mar-20 6:19
professionalZurdoDev20-Mar-20 6:19 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Nelek20-Mar-20 8:48
protectorNelek20-Mar-20 8:48 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
ZurdoDev20-Mar-20 6:10
professionalZurdoDev20-Mar-20 6:10 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Greg Utas20-Mar-20 6:19
professionalGreg Utas20-Mar-20 6:19 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Kent Sharkey20-Mar-20 6:49
staffKent Sharkey20-Mar-20 6:49 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Joe Woodbury20-Mar-20 8:46
professionalJoe Woodbury20-Mar-20 8:46 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Greg Utas23-Mar-20 3:44
professionalGreg Utas23-Mar-20 3:44 
@Mark-Wallace @Member-7989122

In case you're interested, here[^] are the changes that I made as the result of DeepCode's analysis. I summarized what it found in a previous post[^].

I've now run PVS-Studio, made changes based on what it found, and have started regression testing. It generates lots of errors and warnings, many of which are false alarms (some understandably so) or violations of obsessive coding standards (e.g., MISRA). Some of the false alarms involve virtual functions, where it suggests making an argument const even though the function is an override and the argument has to be non-const for other overrides. But some of its "argument could be const" warnings look good but were missed by own static analysis tool[^], so I also have some escape analysis to do.

Here's a summary of most of the changes I made as the result of PVS-Studio's findings:
  • changing unique_ptr.release() to reset() to fix a memory leak
  • adding either a missing break or [[fallthrough]] at the end of a case clause
  • removing an expression that always evaluates to true or false (most were checks for < 0 on an unsigned type)
  • removing checks for nullptr after invoking new (unreachable because an exception occurs if new fails)
  • changing occurrences of (strlen(str) == 0) to (str[0] == NUL) for efficiency
  • moving an invariant call to strlen out of a loop for efficiency
  • changing a type from signed to unsigned or vice versa (usually involving size_t)
  • removing redundant checks or assignments
  • changing the order of data members for more efficient memory usage
  • making an argument const
Mostly cosmetic, but there were some real bugs (the first two bullets).

It also told me that a multithreaded Windows application is supposed to use _beginthreadex instead of CreateThread. This was a revelation and something that I'll be changing later. My code seems to work using CreateThread, but maybe a tiger is waiting to pounce.

GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Mark_Wallace23-Mar-20 6:57
Mark_Wallace23-Mar-20 6:57 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Greg Utas23-Mar-20 7:05
professionalGreg Utas23-Mar-20 7:05 
GeneralRe: DeepCode brings AI-powered code review to C and C++ Pin
Mark_Wallace23-Mar-20 7:17
Mark_Wallace23-Mar-20 7:17 
NewsIT security report finds 97% have suspicious network activity Pin
Kent Sharkey19-Mar-20 10:45
staffKent Sharkey19-Mar-20 10:45 
GeneralRe: IT security report finds 97% have suspicious network activity Pin
Nelek19-Mar-20 11:37
protectorNelek19-Mar-20 11:37 
GeneralRe: IT security report finds 97% have suspicious network activity Pin
Mark_Wallace19-Mar-20 20:18
Mark_Wallace19-Mar-20 20:18 
GeneralRe: IT security report finds 97% have suspicious network activity Pin
Bohdan Stupak21-Mar-20 5:55
professionalBohdan Stupak21-Mar-20 5:55 
NewsExtending the Reach of Windows ML and DirectML Pin
Kent Sharkey19-Mar-20 10:45
staffKent Sharkey19-Mar-20 10:45 
GeneralRe: Extending the Reach of Windows ML and DirectML Pin
Nelek19-Mar-20 11:35
protectorNelek19-Mar-20 11:35 
GeneralRe: Extending the Reach of Windows ML and DirectML Pin
Kent Sharkey19-Mar-20 11:43
staffKent Sharkey19-Mar-20 11:43 
NewsThe world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
Kent Sharkey19-Mar-20 10:30
staffKent Sharkey19-Mar-20 10:30 
GeneralRe: The world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
Nelek19-Mar-20 11:34
protectorNelek19-Mar-20 11:34 
GeneralRe: The world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
Kent Sharkey19-Mar-20 11:37
staffKent Sharkey19-Mar-20 11:37 
GeneralRe: The world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
Nelek19-Mar-20 11:41
protectorNelek19-Mar-20 11:41 
GeneralRe: The world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
Mark_Wallace19-Mar-20 22:13
Mark_Wallace19-Mar-20 22:13 
GeneralRe: The world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
Kaladin20-Mar-20 2:05
Kaladin20-Mar-20 2:05 
QuestionRe: The world's fastest supercomputer identified chemicals that could stop coronavirus from spreading, a crucial step toward a vaccine Pin
ZurdoDev20-Mar-20 6:14
professionalZurdoDev20-Mar-20 6:14 

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.