Skip Navigation Links | |
Exit Print View | |
![]() |
Oracle Solaris Studio 12.3: C User's Guide Oracle Solaris Studio 12.3 Information Library |
1. Introduction to the C Compiler
2. C-Compiler Implementation-Specific Information
4.3.46 -Xustr={ascii_utf16_ushort|no}
4.4.1 Options to Suppress Messages
4.6 lint Reference and Examples
4.6.1 Diagnostics Performed by lint
4.6.1.3 Questionable Constructs
7. Converting Applications for a 64-Bit Environment
8. cscope: Interactively Examining a C Program
A. Compiler Options Grouped by Functionality
B. C Compiler Options Reference
C. Implementation-Defined ISO/IEC C99 Behavior
E. Implementation-Defined ISO/IEC C90 Behavior
H. Oracle Solaris Studio C: Differences Between K&R C and ISO C
The lint program operates in two modes:
Basic, which is the default
Enhanced, which provides additional, detailed analysis of code
In both basic and enhanced modes, lint compensates for separate and independent compilation in C by flagging inconsistencies in definition and use across files, including any libraries you have used. In a large project environment where the same function might be used by different programmers in hundreds of separate modules of code, lint can help discover bugs that otherwise might be difficult to find. A function called with one less argument than expected, for example, looks at the stack for a value the call has never pushed, with results correct in one condition, incorrect in another, depending on whatever happens to be in memory at that stack location. By identifying dependencies like this one and dependencies on machine architecture as well, lint can improve the reliability of code run on your machine or someone else’s.
In enhanced mode, lint provides more detailed reporting than in basic mode. In basic mode, lint’s capabilities include:
Structure and flow analysis of the source program
Constant propagations and constant expression evaluations
Analysis of control flow and data flow
Analysis of data types usage
In enhanced mode, lint can detect these problems:
Unused #include directives, variables, and procedures
Memory usage after its deallocation
Unused assignments
Usage of a variable value before its initialization
Deallocation of nonallocated memory
Usage of pointers when writing in constant data segments
Nonequivalent macro redefinitions
Unreached code
Conformity of the usage of value types in unions
Implicit casts of actual arguments.