Sample Program
On-Line Demonstrations of FlexeLint and PC-lint (aka FlexeLint for Windows)
Introduction and Welcome
Bug of the Month Samples
Introducing the testing facility
Modify this example, if desired, and then hit the Analyse Code button
// // Introduction // // Hello and welcome to Gimpel Software's online Demo. This demo // is intended to demonstrate the static analysis capabilities of // FlexeLint. FlexeLint is sold in two forms: a binary form for // Windows called PC-lint (aka FlexeLint for Windows) and a // platform-independent shrouded source form, known simply as // FlexeLint. // // There's no better way to determine the efficacy of a system // for static analysis than to try some representative code // constructions against the analysis engine before purchase. // The examples may all seem pre-canned but rest assured that // each of them, including this one, can be altered arbitrarily // and so represents a true demonstration. // // Please bear in mind, however, that this is not a secure site // and that you should exhibit caution before submitting large // sections of proprietary code. // // The examples are labeled as either C, C++, or Multiple Module. // To enter C++ code start with one of the examples that are so // labeled. The same for C code. With Multiple Module examples // you can lint several C and/or C++ modules together with // appropriate headers. // // As you may discern from some of the examples, standard C and // C++ header files are available in this demo for inclusion via // #include. Includable headers are those supplied with GCC. // The product, itself, supports most other header systems. In // particular, we support Microsoft headers and MFC. We are in // fact awaiting approval to employ these headers in some of our // examples in this demo. // // Note, there is a limitation to this demo that is not in // the product delivered to the customer: namely, a reasonable // limit has been placed on the number of messages. // // The messages produced by FlexeLint fall into 4 categories: // Error, Warning, Informational (designated as 'Info' in the // output) and Elective Note (designated as 'Note' in the // output). The default warning level is 3 (i.e., you get // Errors, Warnings and Infos). If you want to see Elective // Notes you can set the warning level to 4. The option for this // is '-w4'. Normally, this would be placed on the command line // or within an options file. But you don't have access to the // command line so you will have to place this option within a // special option-bearing comment beginning with 'lint'. For // example, if your code contains // // //lint -w4 // // you will set the warning level to 4 and this will affect all // messages following the option. You can restore things with a // similarly encouched -w3. // // Don't worry that you are seeing more messages than you wanted // to see. It is quite easy to suppress messages. For example // if you don't want to see message 714 then you can use the -e // option as: // // //lint -e714 // // and place this option somewhere before the offensive message // is issued. // // There is a spectacularly rich set of options for suppressing // messages. For example there is message suppression by message // parameter, within specified macros, within specified // functions, within scopes, within expressions, at certain // lines, etc. But for the purpose of this demo, it is not // necessary for you to know what these options are, as long as // you realize that you can tailor the output to your own // specifications. // // Happy linting. // // The Staff at Gimpel Software // //
Run FlexeLint on Bug of the Month Samples
Home
|
Examples
|
Contact
|
Order
PC-lint and FlexeLint are trademarks of Gimpel Software
Copyright © 2011, Gimpel Software