CertC-API04

Provide a consistent and usable error-checking mechanism

Required inputs: IR

Functions should provide consistent and usable error-checking mechanisms. Complex interfaces are sometimes ignored by programmers, resulting in code that is not error checked. Inconsistent interfaces are frequently misused and difficult to use, resulting in lower-quality code and higher development costs.

Noncompliant Code Example ( strlcpy() )

The strlcpy() function copies a null-terminated source string to a destination array. It is designed to be a safer, more consistent, and less error-prone replacement for strcpy() .

The strlcpy() function returns the total length of the string it tried to create (the length of the source string).

To detect truncation, perhaps while building a path name, code such as the following might be used:

char *dir, *file, pname[MAXPATHLEN];

/* ... */

if (strlcpy(pname, dir, sizeof(pname)) >= sizeof(pname)) {
  /* Handle source-string-too long error */
}
Compliant Solution ( strcpy_m() )

The managed string library [ Burch 2006 ] handles errors by consistently returning the status code in the function return value. This approach encourages status checking because the user can insert the function call as the expression in an if statement and take appropriate action on failure.

The strcpy_m() function is an example of a managed string function that copies a source-managed string into a destination-managed string:

errno_t retValue;
string_m dest, source;

/* ... */

if (retValue = strcpy_m(dest, source)) {
  fprintf(stderr, "Error %d from strcpy_m.\n", retValue);
} 

The greatest disadvantage of this approach is that it prevents functions from returning any other value. Consequently, all values (other than the status) returned by a function must be returned as a pass-by-reference parameter, preventing a programmer from nesting function calls. This trade-off is necessary because nesting function calls can conflict with a programmer's willingness to check status codes.

Risk Assessment

Failure to provide a consistent and usable error-checking mechanism can result in type errors in the program.

Rule Severity Likelihood Detectable Repairable Priority Level
API04-C Medium Unlikely No No P2 L3
Related Guidelines
Taxonomy Taxonomy item Relationship
ISO/IEC 9945:2003
Prior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC 23360-1:2006
Prior to 2018-01-12: CERT: Unspecified Relationship
ISO/IEC TR 24731-2
Prior to 2018-01-12: CERT: Unspecified Relationship
MISRA C:2012 Rule 21.3 (required) Prior to 2018-01-12: CERT: Unspecified Relationship
MISRA C:2012 Directive 4.12 (required) Prior to 2018-01-12: CERT: Unspecified Relationship
CWE 2.11 CWE-754 , Improper check for unusual or exceptional conditions Prior to 2018-01-12: CERT:
Bibliography
[ Burch 2006 ]
[ CERT 2006c ]
[ Miller 1999 ]
[ Seacord 2013 ] Chapter 2, "Strings"
Excerpt from SEI CERT C Coding Standard: Rules for Developing Safe, Reliable, and Secure Systems (2016 Edition) and SEI CERT C Coding Standard [https://cmu-sei.github.io/secure-coding-standards/sei-cert-c-coding-standard/recommendations/application-programming-interfaces-api/api04-c], Copyright (C) 1995-2026 Carnegie Mellon University. See 9.4 3rd-Party Licenses in the documentation for full details.

Possible Messages

Key

Text

Severity

Disabled

discarded_return_with_entity

Return value of function discarded.

None

False

forbidden_libfunc_call

This function reports errors in-band; prefer a function that returns a status code.

None

False

unhandled_return_value

Return value of function call not properly checked.

None

False

Options

allow_assignment_to_globals

allow_assignment_to_globals : bool = False

Whether assignment to global / static variables should be allowed. If set to false, an error will be reported if the returned value is assigned to a global variable and any call is performed before checking the return (i.e., some other routine could access the return value before checking it).
 

allow_assignment_to_variables_with_pointers

allow_assignment_to_variables_with_pointers : bool = True

Whether assignment to variables of which the address has been taken somewhere should be allowed. If set to false, an error will be reported if the return value is assigned to such a variable, to ensure that the return value is checked locally, before any access from outside is possible.
 

allowed_functions

allowed_functions : set[bauhaus.analysis.config.FunctionName] = {'memcpy', 'memmove', 'memset', 'strcat', 'strcpy', 'strncat', 'strncpy'}

Calls to these functions are ignored.
 

blacklist

blacklist

Type: dict[bauhaus.analysis.config.FileGlobPattern, list[bauhaus.analysis.config.GlobPattern]]

Default:

{
   '*': ['strlcpy', 'strlcat']
}
Dictionary of header globbing to (list of) function name globbing(s) of forbidden functions.
 

check_operators

check_operators : bool = False

Also check operator calls. Unused return values of assignment operators are only reported if given in function style syntax.
 

functions

functions

Type: dict[bauhaus.analysis.config.QualifiedName, bauhaus.ir.common.algorithms.matchers.Matcher]

Default:

{
   'aligned_alloc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'asctime_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'at_quick_exit': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'atexit': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'bsearch': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'bsearch_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'btowc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109430>,
   'c16rtomb': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'c32rtomb': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'calloc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'clock': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b140>,
   'cnd_broadcast': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'cnd_init': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d4620>,
   'cnd_signal': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'cnd_timedwait': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d6f00>,
   'cnd_wait': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'ctime_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fclose': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fflush': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fgetc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fgetpos': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d51c0>,
   'fgets': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'fgetwc': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310b170>,
   'fopen': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'fopen_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fputc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fputs': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fputwc': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310b170>,
   'fputws': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fread': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'freopen': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'freopen_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fseek': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fsetpos': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d51c0>,
   'ftell': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d5520>,
   'fwprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fwprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fwrite': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'fwscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'fwscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'getc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'getchar': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'getenv': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'getenv_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'gets_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'getwc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109430>,
   'getwchar': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109430>,
   'gmtime': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'gmtime_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'localtime': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'localtime_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'malloc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'mblen': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310a840>,
   'mbrlen': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310bf80>,
   'mbrtoc16': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'mbrtoc32': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'mbrtowc': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'mbsrtowcs': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'mbsrtowcs_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'mbstowcs': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310bf80>,
   'mbstowcs_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'mbtowc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310a840>,
   'memchr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'mktime': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b7a0>,
   'mtx_init': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'mtx_lock': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'mtx_timedlock': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d7110>,
   'mtx_trylock': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d7140>,
   'mtx_unlock': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'printf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'putc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'putwc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109430>,
   'raise': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'realloc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'remove': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'rename': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'scanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'scanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'setlocale': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'setvbuf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'signal': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d5310>,
   'snprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'snprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'sprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'sprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'sscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'sscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'strchr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'strerror_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'strftime': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'strpbrk': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'strrchr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'strstr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'strtod': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtof': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtoimax': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtok': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'strtok_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'strtol': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtold': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtoll': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtoul': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtoull': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strtoumax': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'strxfrm': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'swprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'swprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'swscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'swscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'thrd_create': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d6fc0>,
   'thrd_detach': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'thrd_join': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'thrd_sleep': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'time': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b7a0>,
   'timespec_get': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'tmpfile': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'tmpfile_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'tmpnam': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'tmpnam_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'tss_create': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'tss_get': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'tss_set': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109340>,
   'ungetc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'ungetwc': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109430>,
   'vfprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vfprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vfscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vfscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vfwprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vfwprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vfwscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vfwscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vsnprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vsnprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vsprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vsprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vsscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vsscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vswprintf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vswprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vswscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vswscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vwprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'vwscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'vwscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'wcrtomb': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'wcschr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wcsftime': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'wcspbrk': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wcsrchr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wcsrtombs': <bauhaus.ir.common.algorithms.matchers.OrMatcher object at 0x7f3bf30d52e0>,
   'wcsrtombs_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'wcsstr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wcstod': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstof': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstoimax': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstok': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wcstok_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wcstol': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstold': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstoll': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstombs': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310bf80>,
   'wcstombs_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'wcstoul': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstoull': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcstoumax': <bauhaus.ir.common.algorithms.matchers.BinaryMatcher object at 0x7f3bf310a270>,
   'wcsxfrm': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'wctob': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'wctomb': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310a840>,
   'wctomb_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310a840>,
   'wctrans': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'wctype': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf3109160>,
   'wmemchr': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b350>,
   'wprintf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b320>,
   'wscanf': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>,
   'wscanf_s': <bauhaus.rules.axivion.expressions.calls.unhandled_return_value.BinaryRelationAnyMatcher object at 0x7f3bf310b0b0>
}
Allows to declare function names for which a check must exist. The check is expressed as an IR pattern.
 

known_check_functions

known_check_functions : set[bauhaus.analysis.config.FunctionName] = set()

Collection of functions which are known to test return values of functions under test.
 

report_references

report_references : bool = False

Report returned references. For operators, unused returned references are only reported if given in function style syntax.