Skip to main content
assistive.skiplink.to.breadcrumbs
assistive.skiplink.to.header.menu
assistive.skiplink.to.action.menu
assistive.skiplink.to.quick.search
Log in
Confluence
Spaces
Hit enter to search
Help
Online Help
Keyboard Shortcuts
Feed Builder
What’s new
Available Gadgets
About Confluence
Log in
SEI CERT C Coding Standard
Pages
Boards
Space shortcuts
Dashboard
Secure Coding Home
Android
C
C++
Java
Perl
Page tree
Browse pages
Configure
Space tools
View Page
A
t
tachments (0)
Page History
Page Information
View in Hierarchy
View Source
Export to PDF
Export to Word
Pages
…
SEI CERT C Coding Standard
4 Back Matter
EE. Analyzers
PC-lint Plus
Page Information
Title:
PC-lint Plus
Author:
Alex Bock
Feb 23, 2021
Last Changed by:
David Svoboda
Oct 14, 2024
Tiny Link:
(useful for email)
https://wiki.sei.cmu.edu/confluence/x/A4AvE
Export As:
Word
·
PDF
Incoming Links
SEI CERT C Coding Standard (151)
Page:
CON37-C. Do not call signal() in a multithreaded program
Page:
MEM30-C. Do not access freed memory
Page:
PRE31-C. Avoid side effects in arguments to unsafe macros
Page:
STR34-C. Cast characters to unsigned char before converting to larger integer sizes
Page:
POS54-C. Detect and handle POSIX library errors
Page:
ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
Page:
CON32-C. Prevent data races when accessing bit-fields from multiple threads
Page:
DCL23-C. Guarantee that mutually visible identifiers are unique
Page:
EXP05-C. Do not cast away a const qualification
Page:
WIN00-C. Be specific when dynamically loading libraries
Page:
FIO30-C. Exclude user input from format strings
Page:
POS47-C. Do not use threads that can be canceled asynchronously
Page:
DCL19-C. Minimize the scope of variables and functions
Page:
EXP46-C. Do not use a bitwise operator with a Boolean-like operand
Page:
STR05-C. Use pointers to const when referring to string literals
Page:
INT36-C. Converting a pointer to integer or integer to pointer
Page:
STR09-C. Don't assume numeric values for expressions with type plain character
Page:
EXP13-C. Treat relational and equality operators as if they were nonassociative
Page:
EXP43-C. Avoid undefined behavior when using restrict-qualified pointers
Page:
ARR00-C. Understand how arrays work
Page:
EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place
Page:
DCL16-C. Use "L," not "l," to indicate a long value
Page:
DCL18-C. Do not begin integer constants with 0 when specifying a decimal value
Page:
DCL30-C. Declare objects with appropriate storage durations
Page:
MSC30-C. Do not use the rand() function for generating pseudorandom numbers
Page:
MSC17-C. Finish every set of statements associated with a case label with a break statement
Page:
INT02-C. Understand integer conversion rules
Page:
CON33-C. Avoid race conditions when using library functions
Page:
STR30-C. Do not attempt to modify string literals
Page:
EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators
Page:
MSC33-C. Do not pass invalid data to the asctime() function
Page:
SIG30-C. Call only asynchronous-safe functions within signal handlers
Page:
DCL04-C. Do not declare more than one variable per declaration
Page:
EXP34-C. Do not dereference null pointers
Page:
MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
Page:
DCL15-C. Declare file-scope objects or functions that do not need external linkage as static
Page:
INT00-C. Understand the data model used by your implementation(s)
Page:
MSC01-C. Strive for logical completeness
Page:
ERR07-C. Prefer functions that support error checking over equivalent functions that don't
Page:
EXP00-C. Use parentheses for precedence of operation
Page:
FLP02-C. Avoid using floating-point numbers when precise computation is needed
Page:
DCL31-C. Declare identifiers before using them
Page:
MEM11-C. Do not assume infinite heap space
Page:
ARR38-C. Guarantee that library functions do not form invalid pointers
Page:
DCL13-C. Declare function parameters that are pointers to values not changed by the function as const
Page:
ERR06-C. Understand the termination behavior of assert() and abort()
Page:
DCL00-C. Const-qualify immutable objects
Page:
POS04-C. Avoid using PTHREAD_MUTEX_NORMAL type mutex locks
Page:
SIG00-C. Mask signals handled by noninterruptible signal handlers
Page:
EXP44-C. Do not rely on side effects in operands to sizeof, _Alignof, or _Generic
Page:
MSC41-C. Never hard code sensitive information
Page:
MEM00-C. Allocate and free memory in the same module, at the same level of abstraction
Page:
API00-C. Functions should validate their parameters
Page:
STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator
Page:
MSC12-C. Detect and remove code that has no effect or is never executed
Page:
INT13-C. Use bitwise operators only on unsigned operands
Page:
MSC32-C. Properly seed pseudorandom number generators
Page:
ERR33-C. Detect and handle standard library errors
Page:
WIN01-C. Do not forcibly terminate execution
Page:
MEM12-C. Consider using a goto chain when leaving a function on error when using and releasing resources
Page:
PRE32-C. Do not use preprocessor directives in invocations of function-like macros
Page:
MSC04-C. Use comments consistently and in a readable fashion
Page:
ARR02-C. Explicitly specify array bounds, even if implicitly defined by an initializer
Page:
INT08-C. Verify that all integer values are in range
Page:
DCL01-C. Do not reuse variable names in subscopes
Page:
PRE11-C. Do not conclude macro definitions with a semicolon
Page:
FIO42-C. Close files when they are no longer needed
Page:
API09-C. Compatible values should have the same type
Page:
ERR04-C. Choose an appropriate termination strategy
Page:
STR10-C. Do not concatenate different type of string literals
Page:
PRE02-C. Macro replacement lists should be parenthesized
Page:
EXP36-C. Do not cast pointers into more strictly aligned pointer types
Page:
STR38-C. Do not confuse narrow and wide character strings and functions
Page:
MSC21-C. Use robust loop termination conditions
Page:
FIO47-C. Use valid format strings
Page:
FIO46-C. Do not access a closed file
Page:
PRE05-C. Understand macro replacement when concatenating tokens or performing stringification
Page:
CON43-C. Do not allow data races in multithreaded code
Page:
FIO39-C. Do not alternately input and output from a stream without an intervening flush or positioning call
Page:
INT09-C. Ensure enumeration constants map to unique values
Page:
DCL20-C. Explicitly specify void when a function accepts no arguments
Page:
DCL37-C. Do not declare or define a reserved identifier
Page:
EXP45-C. Do not perform assignments in selection statements
Page:
FLP03-C. Detect and handle floating-point errors
Page:
POS44-C. Do not use signals to terminate threads
Page:
SIG02-C. Avoid using signals to implement normal functionality
Page:
INT16-C. Do not make assumptions about representation of signed integers
Page:
CON01-C. Acquire and release synchronization primitives in the same module, at the same level of abstraction
Page:
EXP42-C. Do not compare padding data
Page:
SIG34-C. Do not call signal() from within interruptible signal handlers
Page:
FLP06-C. Convert integers to floating point for floating-point operations
Page:
FIO38-C. Do not copy a FILE object
Page:
INT07-C. Use only explicitly signed or unsigned char type for numeric values
Page:
FIO13-C. Never push back anything other than one read character
Page:
MSC13-C. Detect and remove unused values
Page:
ARR01-C. Do not apply the sizeof operator to a pointer when taking the size of an array
Page:
DCL07-C. Include the appropriate type information in function declarators
Page:
FLP30-C. Do not use floating-point variables as loop counters
Page:
INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs
Page:
SIG35-C. Do not return from a computational exception signal handler
Page:
MEM34-C. Only free memory allocated dynamically
Page:
STR11-C. Do not specify the bound of a character array initialized with a string literal
Page:
FLP34-C. Ensure that floating-point conversions are within range of the new type
Page:
SIG31-C. Do not access shared objects in signal handlers
Page:
MSC20-C. Do not use a switch statement to transfer control into a complex block
Page:
ARR32-C. Ensure size arguments for variable length arrays are in a valid range
Page:
MEM05-C. Avoid large stack allocations
Page:
MEM35-C. Allocate sufficient memory for an object
Page:
MSC06-C. Beware of compiler optimizations
Page:
ARR37-C. Do not add or subtract an integer to a pointer to a non-array object
Page:
PRE10-C. Wrap multistatement macros in a do-while loop
Page:
FLP36-C. Preserve precision when converting integral values to floating-point type
Page:
DCL40-C. Do not create incompatible declarations of the same function or object
Page:
CON35-C. Avoid deadlock by locking in a predefined order
Page:
EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement
Page:
MSC18-C. Be careful while handling sensitive data, such as passwords, in program code
Page:
EXP12-C. Do not ignore values returned by functions
Page:
DCL38-C. Use the correct syntax when declaring a flexible array member
Page:
ERR34-C. Detect errors when converting a string to a number
Page:
DCL10-C. Maintain the contract between the writer and caller of variadic functions
Page:
MEM31-C. Free dynamically allocated memory when no longer needed
Page:
DCL02-C. Use visually distinct identifiers
Page:
WIN02-C. Restrict privileges when spawning child processes
Page:
ENV01-C. Do not make assumptions about the size of an environment variable
Page:
DCL11-C. Understand the type issues associated with variadic functions
Page:
EXP19-C. Use braces for the body of an if, for, or while statement
Page:
EXP47-C. Do not call va_arg with an argument of the incorrect type
Page:
DCL41-C. Do not declare variables inside a switch statement before the first case label
Page:
MSC24-C. Do not use deprecated or obsolescent functions
Page:
FLP37-C. Do not use object representations to compare floating-point values
Page:
PRE06-C. Enclose header files in an include guard
Page:
POS49-C. When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed
Page:
EXP33-C. Do not read uninitialized memory
Page:
INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression
Page:
MSC19-C. For functions that return an array, prefer returning an empty array over a null value
Page:
EXP30-C. Do not depend on the order of evaluation for side effects
Page:
SIG01-C. Understand implementation-specific details regarding signal handler persistence
Page:
DCL36-C. Do not declare an identifier with conflicting linkage classifications
Page:
ENV33-C. Do not call system()
Page:
STR07-C. Use the bounds-checking interfaces for string manipulation
Page:
EXP08-C. Ensure pointer arithmetic is used correctly
Page:
MSC37-C. Ensure that control never reaches the end of a non-void function
Page:
PRE01-C. Use parentheses within macros around parameter names
Page:
PRE07-C. Avoid using repeated question marks
Page:
EXP20-C. Perform explicit tests to determine success, true and false, and equality
Page:
FIO11-C. Take care when specifying the mode parameter of fopen()
Page:
FLP32-C. Prevent or detect domain and range errors in math functions
Page:
PRE00-C. Prefer inline or static functions to function-like macros
Page:
FLP00-C. Understand the limitations of floating-point numbers
Page:
EXP16-C. Do not compare function pointers to constant values
Page:
POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument
Hierarchy
Parent Page
Page:
EE. Analyzers
Labels
Global Labels (1)
analyzer
Recent Changes
Time
Editor
Oct 14, 2024 07:26
David Svoboda
View Changes
Feb 08, 2024 09:05
David Svoboda
View Changes
Sep 27, 2023 08:25
David Svoboda
View Changes
Jul 13, 2023 13:28
David Svoboda
View Changes
Jun 06, 2023 12:24
David Svoboda
View Page History
Outgoing Links
External Links (151)
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
https://wiki.sei.cmu.edu/confluence/pages/viewpage.action?p…
SEI CERT C Coding Standard (1)
Page:
PC-lint Plus_V
Overview
Content Tools
{"serverDuration": 227, "requestCorrelationId": "50507fd2a8a813d1"}