JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++
Binaries

Attributes

The CodeSonar Extension API supports attributes, which associate user-defined information with one or more memory addresses. This information can be updated whenever the variables undergo operations that could lead to a weakness, and used to trigger warnings in appropriate cases.

Attribute values cannot be manipulated or read with normal C/C++ language constructs. Instead we have provided prototype functions that you can instantiate and use to define and access attributes and their values:

All attribute names beginning with csonar_ are reserved, as are the following.

alloc Distance (in bits) between location and end of region
allocator Used for Type Mismatch checking.
arraycardinality Used to store cardinality of operator new[] allocations.
cpparray Used by Type Mismatch to detect new/delete[] and new[]/delete mismatch.
dereferenced Used for Null Test After Dereference checking.
escaped Records whether a pointer has "escaped" the analysis' ability to track it.
  • 0: No
  • 1: Yes
freed Records whether location has been freed.
  • 0: location is dynamically allocated
  • 1: location has been freed
-1: location is not dynamically allocated
fromend Distance (in bits) from location to the end of the referred-to field.
functionscope Scope ID for functions.
globalalloc_flags Used to detect problems with some Windows functions.
initialized Records whether location has been initialized.
  • 0: No
  • 1: Yes
int "Normal" memory.
localalloc_flags Used to detect problems with some Windows functions.
lock_acquire_failed Used by Data Race check to record whether a lock attempt has failed.
lock_name Used by Data Race check to track lock names associated with locks (for certain embedded operating systems that identify locks by names).
locked Used for Double Lock, Double Unlock, and Try-lock that will never succeed checking.
nullchecked Used for Null Test After Dereference checking.
openmp_private Used for Data Race checking.
openmp_shared Used for Data Race checking.
pool Used for Pool Mismatch checking: indicates the memory pool to which allocation belongs.
ralloc Distance in bits between location and beginning of region.
relay_locked Used for Data Race checking: indicates whether a lock is held.
scope Scope ID.
semid Used for concurrency checks.
ssocket Used for Socket In Wrong State checking.
term Distance in bits between location and null sentinel.
thread_local Used to implement thread-local storage.
thread_parameter Used by Data Race check to discover thread parameters.
tocttou Used by File System Race Condition check.
 

To report problems with this documentation, please visit https://support.codesecure.com/.