Monday, September 26, 2011

Incremental Linting with FlexeLint

Tools like FlexeLint are great for finding and preventing bugs and the bad practices that are often associated with them and little argument can be made for not using a good static analysis tool from the inception of a new project.  Many times however, it is desired to start reaping the benefits of such a tool with an existing code base.  The initial scan of even a carefully configured FlexeLint installation can generate a daunting number of messages that simply are not practical to address before continuing development.  Because of this, such tools are often not used on established code bases.  Being able to establish a baseline snapshot of a code base and receive diagnostics only for new or changed code would make using FlexeLint significantly more manageable for such projects and allow previously existing issues to be addressed in a more practical timeline.  Such a method can also be used to easily track issues introduced between different versions.

This post discusses a method to run FlexeLint so as to receive messages only on code that differs from a specific baseline.  The examples use FlexeLint but the ideas are relatively simple and can be easily modified to work with other tools as well.

Monday, September 5, 2011

Suppressing messages for particular files in FlexeLint

A commonly asked question regarding Flexelint is how one can suppress some or all messages for a particular file.  Although there isn't an individual option to accompish this, like there is for suppressing messages for specific symbols, types, etc., there are several ways to achieve the same effect.

Saturday, May 28, 2011

How Well Do You Know C?

Think you have mastered the ins and outs of the C language? Test your knowledge of the nuances of C by trying to determine what is printed by each of the following programs. All code is C99 and exhibits well-defined behavior. Answers and discussion follow.

Saturday, May 7, 2011

FlexeLint: A Modern Static Analyzer for C and C++

Static analysis is a powerful technique for quickly finding programming defects in the earliest stages of development and is especially useful for statically typed languages like C and C++. In this post I will discuss FlexeLint, a mature static analysis tool for C and C++ from Gimpel Software. Plenty of examples are provided to demonstrate many of the features and types of issues the tool can detect. Although it is impossible to cover everything about a tool as featureful as FlexeLint in a single post, I will attempt to provide firm understanding of what the tool is capable of and how it can improve the quality of your code. If you are a serious C or C++ programmer, you will greatly benefit by using static analysis and FlexeLint is one of the best, and least expensive, tools out there today.

Thursday, April 28, 2011

Cooperative Limiting of Concurrent Process Instances

It is a common desire to limit the number of instances of a specific program for one of several reasons including resource management, ensuring programs not meant to handle multiple concurrent instances are run only once, or managing license restrictions. In this post I will detail a method for managing the number of concurrent instances of a process or group of processes in a manner that does not require alteration of the programs being limited and avoids a number of issues with existing methods that usually do.