GitHub
CERT Secure Coding

PC-lint Plus

This page was automatically generated and should not be edited.

The information on this page was provided by outside contributors and has not been verified by SEI CERT.

The table below can be re-ordered, by clicking column headers.

Tool Version: 1.4

CheckerGuideline
1MSC04-C. Use comments consistently and in a readable fashion
18DCL40-C. Do not create incompatible declarations of the same function or object
111DCL13-C. Declare function parameters that are pointers to values not changed by the function as const
175DCL11-C. Understand the type issues associated with variadic functions
401DCL36-C. Do not declare an identifier with conflicting linkage classifications
409ARR00-C. Understand how arrays work
413EXP34-C. Do not dereference null pointers
413ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
413POS54-C. Detect and handle POSIX library errors
413API00-C. Functions should validate their parameters
413ARR00-C. Understand how arrays work
413MEM11-C. Do not assume infinite heap space
413MSC19-C. For functions that return an array, prefer returning an empty array over a null value
415ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
416ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
416EXP08-C. Ensure pointer arithmetic is used correctly
418EXP34-C. Do not dereference null pointers
418MSC19-C. For functions that return an array, prefer returning an empty array over a null value
419ARR38-C. Guarantee that library functions do not form invalid pointers
419MSC19-C. For functions that return an array, prefer returning an empty array over a null value
420ARR38-C. Guarantee that library functions do not form invalid pointers
420MSC19-C. For functions that return an array, prefer returning an empty array over a null value
421STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator
424MEM34-C. Only free memory allocated dynamically
427MSC04-C. Use comments consistently and in a readable fashion
429MEM31-C. Free dynamically allocated memory when no longer needed
429FIO42-C. Close files when they are no longer needed
429ARR00-C. Understand how arrays work
429MEM12-C. Consider using a goto chain when leaving a function on error when using and releasing resources
433MEM35-C. Allocate sufficient memory for an object
436PRE32-C. Do not use preprocessor directives in invocations of function-like macros
438MSC12-C. Detect and remove code that has no effect or is never executed
438MSC13-C. Detect and remove unused values
440MSC21-C. Use robust loop termination conditions
442MSC21-C. Use robust loop termination conditions
443MSC21-C. Use robust loop termination conditions
444EXP34-C. Do not dereference null pointers
444MSC21-C. Use robust loop termination conditions
445MSC21-C. Use robust loop termination conditions
449MEM30-C. Do not access freed memory
449MEM00-C. Allocate and free memory in the same module, at the same level of abstraction
454CON01-C. Acquire and release synchronization primitives in the same module, at the same level of abstraction
455CON01-C. Acquire and release synchronization primitives in the same module, at the same level of abstraction
456CON01-C. Acquire and release synchronization primitives in the same module, at the same level of abstraction
457CON32-C. Prevent data races when accessing bit-fields from multiple threads
457CON43-C. Do not allow data races in multithreaded code
457POS49-C. When data must be accessed by multiple threads, provide a mutex and guarantee no adjacent data is also accessed
473MSC19-C. For functions that return an array, prefer returning an empty array over a null value
474MSC01-C. Strive for logical completeness
474MSC12-C. Detect and remove code that has no effect or is never executed
488INT09-C. Ensure enumeration constants map to unique values
489STR30-C. Do not attempt to modify string literals
492FIO47-C. Use valid format strings
493FIO47-C. Use valid format strings
494FIO47-C. Use valid format strings
498STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator
499FIO47-C. Use valid format strings
501INT02-C. Understand integer conversion rules
502INT02-C. Understand integer conversion rules
502INT16-C. Do not make assumptions about representation of signed integers
503EXP13-C. Treat relational and equality operators as if they were nonassociative
505MSC12-C. Detect and remove code that has no effect or is never executed
505MSC13-C. Detect and remove unused values
514EXP46-C. Do not use a bitwise operator with a Boolean-like operand
522MSC12-C. Detect and remove code that has no effect or is never executed
523MSC12-C. Detect and remove code that has no effect or is never executed
527DCL41-C. Do not declare variables inside a switch statement before the first case label
527MSC12-C. Detect and remove code that has no effect or is never executed
528MSC12-C. Detect and remove code that has no effect or is never executed
529MSC12-C. Detect and remove code that has no effect or is never executed
529MSC13-C. Detect and remove unused values
530EXP33-C. Do not read uninitialized memory
533MSC37-C. Ensure that control never reaches the end of a non-void function
534ERR33-C. Detect and handle standard library errors
534POS54-C. Detect and handle POSIX library errors
534EXP12-C. Do not ignore values returned by functions
557FIO47-C. Use valid format strings
558FIO47-C. Use valid format strings
558DCL10-C. Maintain the contract between the writer and caller of variadic functions
559FIO47-C. Use valid format strings
559DCL11-C. Understand the type issues associated with variadic functions
559INT00-C. Understand the data model used by your implementation(s)
563MSC12-C. Detect and remove code that has no effect or is never executed
564EXP30-C. Do not depend on the order of evaluation for side effects
564EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place
566FIO47-C. Use valid format strings
569INT02-C. Understand integer conversion rules
570INT02-C. Understand integer conversion rules
571STR34-C. Cast characters to unsigned char before converting to larger integer sizes
573INT02-C. Understand integer conversion rules
574INT02-C. Understand integer conversion rules
576ARR02-C. Explicitly specify array bounds, even if implicitly defined by an initializer
578DCL01-C. Do not reuse variable names in subscopes
584PRE07-C. Avoid using repeated question marks
586EXP43-C. Avoid undefined behavior when using restrict-qualified pointers
586ENV33-C. Do not call system()
586ERR34-C. Detect errors when converting a string to a number
586CON33-C. Avoid race conditions when using library functions
586CON37-C. Do not call signal() in a multithreaded program
586MSC30-C. Do not use the rand() function for generating pseudorandom numbers
586MSC33-C. Do not pass invalid data to the asctime() function
586POS44-C. Do not use signals to terminate threads
586POS47-C. Do not use threads that can be canceled asynchronously
586ERR04-C. Choose an appropriate termination strategy
586ERR06-C. Understand the termination behavior of assert() and abort()
586ERR07-C. Prefer functions that support error checking over equivalent functions that don't
586INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs
586MSC06-C. Beware of compiler optimizations
586MSC18-C. Be careful while handling sensitive data, such as passwords, in program code
586MSC24-C. Do not use deprecated or obsolescent functions
586POS04-C. Avoid using PTHREAD_MUTEX_NORMAL type mutex locks
586SIG00-C. Mask signals handled by noninterruptible signal handlers
586SIG01-C. Understand implementation-specific details regarding signal handler persistence
586SIG02-C. Avoid using signals to implement normal functionality
586WIN00-C. Be specific when dynamically loading libraries
586WIN01-C. Do not forcibly terminate execution
586WIN02-C. Restrict privileges when spawning child processes
592FIO30-C. Exclude user input from format strings
601DCL31-C. Declare identifiers before using them
602MSC04-C. Use comments consistently and in a readable fashion
603EXP33-C. Do not read uninitialized memory
604DCL30-C. Declare objects with appropriate storage durations
612MSC12-C. Detect and remove code that has no effect or is never executed
613EXP34-C. Do not dereference null pointers
613ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
613POS54-C. Detect and handle POSIX library errors
613API00-C. Functions should validate their parameters
613ARR00-C. Understand how arrays work
613MEM11-C. Do not assume infinite heap space
613MSC19-C. For functions that return an array, prefer returning an empty array over a null value
616MSC17-C. Finish every set of statements associated with a case label with a break statement
620DCL16-C. Use "L," not "l," to indicate a long value
621DCL40-C. Do not create incompatible declarations of the same function or object
621DCL23-C. Guarantee that mutually visible identifiers are unique
644EXP33-C. Do not read uninitialized memory
646MSC20-C. Do not use a switch statement to transfer control into a complex block
648INT08-C. Verify that all integer values are in range
650INT08-C. Verify that all integer values are in range
653FLP06-C. Convert integers to floating point for floating-point operations
661ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
661MSC19-C. For functions that return an array, prefer returning an empty array over a null value
662ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
662MSC19-C. For functions that return an array, prefer returning an empty array over a null value
666PRE31-C. Avoid side effects in arguments to unsafe macros
668EXP34-C. Do not dereference null pointers
668API00-C. Functions should validate their parameters
668MSC19-C. For functions that return an array, prefer returning an empty array over a null value
669ENV01-C. Do not make assumptions about the size of an environment variable
669MSC19-C. For functions that return an array, prefer returning an empty array over a null value
670MSC19-C. For functions that return an array, prefer returning an empty array over a null value
673MEM34-C. Only free memory allocated dynamically
674DCL30-C. Declare objects with appropriate storage durations
676ARR30-C. Do not form or use out-of-bounds pointers or array subscripts
679INT08-C. Verify that all integer values are in range
680INT08-C. Verify that all integer values are in range
682ARR01-C. Do not apply the sizeof operator to a pointer when taking the size of an array
689MSC04-C. Use comments consistently and in a readable fashion
697EXP20-C. Perform explicit tests to determine success, true and false, and equality
701INT02-C. Understand integer conversion rules
702INT02-C. Understand integer conversion rules
705FIO47-C. Use valid format strings
705INT00-C. Understand the data model used by your implementation(s)
706FIO47-C. Use valid format strings
706INT00-C. Understand the data model used by your implementation(s)
707STR10-C. Do not concatenate different type of string literals
714MSC12-C. Detect and remove code that has no effect or is never executed
715MSC12-C. Detect and remove code that has no effect or is never executed
715MSC13-C. Detect and remove unused values
718DCL31-C. Declare identifiers before using them
718DCL07-C. Include the appropriate type information in function declarators
719FIO47-C. Use valid format strings
719DCL10-C. Maintain the contract between the writer and caller of variadic functions
719MSC12-C. Detect and remove code that has no effect or is never executed
720EXP45-C. Do not perform assignments in selection statements
721EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement
722EXP15-C. Do not place a semicolon on the same line as an if, for, or while statement
731EXP13-C. Treat relational and equality operators as if they were nonassociative
732INT02-C. Understand integer conversion rules
733DCL30-C. Declare objects with appropriate storage durations
734INT02-C. Understand integer conversion rules
735FLP34-C. Ensure that floating-point conversions are within range of the new type
736FLP34-C. Ensure that floating-point conversions are within range of the new type
736FLP03-C. Detect and handle floating-point errors
737API09-C. Compatible values should have the same type
737INT02-C. Understand integer conversion rules
744MSC01-C. Strive for logical completeness
746DCL31-C. Declare identifiers before using them
746DCL07-C. Include the appropriate type information in function declarators
749MSC12-C. Detect and remove code that has no effect or is never executed
750MSC12-C. Detect and remove code that has no effect or is never executed
751MSC12-C. Detect and remove code that has no effect or is never executed
752MSC12-C. Detect and remove code that has no effect or is never executed
753MSC12-C. Detect and remove code that has no effect or is never executed
754MSC12-C. Detect and remove code that has no effect or is never executed
755MSC12-C. Detect and remove code that has no effect or is never executed
756MSC12-C. Detect and remove code that has no effect or is never executed
757MSC12-C. Detect and remove code that has no effect or is never executed
758MSC12-C. Detect and remove code that has no effect or is never executed
765DCL15-C. Declare file-scope objects or functions that do not need external linkage as static
765DCL19-C. Minimize the scope of variables and functions
768MSC12-C. Detect and remove code that has no effect or is never executed
769MSC12-C. Detect and remove code that has no effect or is never executed
773PRE02-C. Macro replacement lists should be parenthesized
774MSC12-C. Detect and remove code that has no effect or is never executed
776INT08-C. Verify that all integer values are in range
777FLP00-C. Understand the limitations of floating-point numbers
777FLP02-C. Avoid using floating-point numbers when precise computation is needed
784STR11-C. Do not specify the bound of a character array initialized with a string literal
787MSC01-C. Strive for logical completeness
789DCL30-C. Declare objects with appropriate storage durations
790FLP06-C. Convert integers to floating point for floating-point operations
793DCL40-C. Do not create incompatible declarations of the same function or object
808DCL31-C. Declare identifiers before using them
816FIO47-C. Use valid format strings
818DCL13-C. Declare function parameters that are pointers to values not changed by the function as const
823PRE11-C. Do not conclude macro definitions with a semicolon
825MSC17-C. Finish every set of statements associated with a case label with a break statement
826MEM35-C. Allocate sufficient memory for an object
827MSC12-C. Detect and remove code that has no effect or is never executed
838MSC12-C. Detect and remove code that has no effect or is never executed
838MSC13-C. Detect and remove unused values
839DCL36-C. Do not declare an identifier with conflicting linkage classifications
846INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression
853MSC04-C. Use comments consistently and in a readable fashion
854PRE07-C. Avoid using repeated question marks
855FIO47-C. Use valid format strings
882ARR01-C. Do not apply the sizeof operator to a pointer when taking the size of an array
901EXP33-C. Do not read uninitialized memory
908MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type
915FLP34-C. Ensure that floating-point conversions are within range of the new type
915FLP36-C. Preserve precision when converting integral values to floating-point type
922FLP34-C. Ensure that floating-point conversions are within range of the new type
922FLP36-C. Preserve precision when converting integral values to floating-point type
931EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place
936DCL07-C. Include the appropriate type information in function declarators
937DCL20-C. Explicitly specify void when a function accepts no arguments
942FLP06-C. Convert integers to floating point for floating-point operations
952INT08-C. Verify that all integer values are in range
953DCL00-C. Const-qualify immutable objects
958EXP42-C. Do not compare padding data
959EXP42-C. Do not compare padding data
967PRE06-C. Enclose header files in an include guard
973PRE02-C. Macro replacement lists should be parenthesized
978DCL37-C. Do not declare or define a reserved identifier
1051DCL36-C. Do not declare an identifier with conflicting linkage classifications
1776STR30-C. Do not attempt to modify string literals
1776STR05-C. Use pointers to const when referring to string literals
1972MSC12-C. Detect and remove code that has no effect or is never executed
2401FIO47-C. Use valid format strings
2402FIO47-C. Use valid format strings
2403FIO47-C. Use valid format strings
2403INT00-C. Understand the data model used by your implementation(s)
2404FIO47-C. Use valid format strings
2405FIO47-C. Use valid format strings
2406FIO47-C. Use valid format strings
2407FIO47-C. Use valid format strings
2408DCL11-C. Understand the type issues associated with variadic functions
2423FLP32-C. Prevent or detect domain and range errors in math functions
2434MEM30-C. Do not access freed memory
2434MEM00-C. Allocate and free memory in the same module, at the same level of abstraction
2440EXP16-C. Do not compare function pointers to constant values
2441EXP16-C. Do not compare function pointers to constant values
2445EXP36-C. Do not cast pointers into more strictly aligned pointer types
2454STR38-C. Do not confuse narrow and wide character strings and functions
2460MSC32-C. Properly seed pseudorandom number generators
2460MSC41-C. Never hard code sensitive information
2461MSC32-C. Properly seed pseudorandom number generators
2462CON35-C. Avoid deadlock by locking in a predefined order
2470FIO13-C. Never push back anything other than one read character
2471FIO46-C. Do not access a closed file
2472FIO11-C. Take care when specifying the mode parameter of fopen()
2473FIO11-C. Take care when specifying the mode parameter of fopen()
2478FIO39-C. Do not alternately input and output from a stream without an intervening flush or positioning call
2479FIO39-C. Do not alternately input and output from a stream without an intervening flush or positioning call
2480STR38-C. Do not confuse narrow and wide character strings and functions
2481STR38-C. Do not confuse narrow and wide character strings and functions
2498FLP37-C. Do not use object representations to compare floating-point values
2499FLP37-C. Do not use object representations to compare floating-point values
2601POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument
2650MSC21-C. Use robust loop termination conditions
2662ARR37-C. Do not add or subtract an integer to a pointer to a non-array object
2666PRE31-C. Avoid side effects in arguments to unsafe macros
2670SIG30-C. Call only asynchronous-safe functions within signal handlers
2671SIG35-C. Do not return from a computational exception signal handler
2704INT08-C. Verify that all integer values are in range
2704INT16-C. Do not make assumptions about representation of signed integers
2760MSC32-C. Properly seed pseudorandom number generators
2761SIG30-C. Call only asynchronous-safe functions within signal handlers
2762SIG34-C. Do not call signal() from within interruptible signal handlers
2763SIG34-C. Do not call signal() from within interruptible signal handlers
2764SIG35-C. Do not return from a computational exception signal handler
2765SIG31-C. Do not access shared objects in signal handlers
4287INT36-C. Converting a pointer to integer or integer to pointer
4376DCL40-C. Do not create incompatible declarations of the same function or object
9001DCL18-C. Do not begin integer constants with 0 when specifying a decimal value
9003DCL19-C. Minimize the scope of variables and functions
9005EXP05-C. Do not cast away a const qualification
9006EXP44-C. Do not rely on side effects in operands to sizeof, _Alignof, or _Generic
9007EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators
9009FLP30-C. Do not use floating-point variables as loop counters
9012EXP19-C. Use braces for the body of an if, for, or while statement
9013MSC01-C. Strive for logical completeness
9022PRE01-C. Use parentheses within macros around parameter names
9024PRE05-C. Understand macro replacement when concatenating tokens or performing stringification
9026PRE00-C. Prefer inline or static functions to function-like macros
9035ARR32-C. Ensure size arguments for variable length arrays are in a valid range
9035MEM05-C. Avoid large stack allocations
9040DCL38-C. Use the correct syntax when declaring a flexible array member
9046DCL02-C. Use visually distinct identifiers
9047FIO38-C. Do not copy a FILE object
9050EXP00-C. Use parentheses for precedence of operation
9055MSC20-C. Do not use a switch statement to transfer control into a complex block
9059MSC04-C. Use comments consistently and in a readable fashion
9060MSC04-C. Use comments consistently and in a readable fashion
9060PRE07-C. Avoid using repeated question marks
9066MSC04-C. Use comments consistently and in a readable fashion
9070MEM05-C. Avoid large stack allocations
9071DCL37-C. Do not declare or define a reserved identifier
9074DCL07-C. Include the appropriate type information in function declarators
9088INT16-C. Do not make assumptions about representation of signed integers
9093DCL37-C. Do not declare or define a reserved identifier
9112INT07-C. Use only explicitly signed or unsigned char type for numeric values
9118FLP34-C. Ensure that floating-point conversions are within range of the new type
9120FLP03-C. Detect and handle floating-point errors
9146DCL04-C. Do not declare more than one variable per declaration
9148INT09-C. Ensure enumeration constants map to unique values
9209STR09-C. Don't assume numeric values for expressions with type plain character
9227FLP34-C. Ensure that floating-point conversions are within range of the new type
9227FLP03-C. Detect and handle floating-point errors
9233INT13-C. Use bitwise operators only on unsigned operands
9252FLP00-C. Understand the limitations of floating-point numbers
9252FLP02-C. Avoid using floating-point numbers when precise computation is needed
9259MSC04-C. Use comments consistently and in a readable fashion
9501PRE32-C. Do not use preprocessor directives in invocations of function-like macros
9502PRE10-C. Wrap multistatement macros in a do-while loop