clang 23.0.0git
clang::analysis Namespace Reference

Functions

bool isAnnexKAvailable (Preprocessor *PP, const LangOptions &LO)
 Calculates whether Annex K is available for the current translation unit based on the macro definitions and the language options.

Function Documentation

◆ isAnnexKAvailable()

bool clang::analysis::isAnnexKAvailable ( Preprocessor * PP,
const LangOptions & LO )
nodiscard

Calculates whether Annex K is available for the current translation unit based on the macro definitions and the language options.

Annex K (Bounds-checking interfaces) is available when:

  1. C11 standard is enabled
  2. STDC_LIB_EXT1 macro is defined (indicates library support)
  3. STDC_WANT_LIB_EXT1 macro is defined and equals "1" (indicates user opt-in)
Parameters
PPThe preprocessor instance to check macro definitions.
LOThe language options to check C11 standard.
Returns
true if Annex K is available, false otherwise.

Definition at line 21 of file AnnexKDetection.cpp.

References clang::Preprocessor::getIdentifierInfo(), clang::Preprocessor::getMacroInfo(), clang::Preprocessor::isMacroDefined(), and clang::T.