Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

lib_def.h

Prototype

Code Block
LanguageC++
CaptionTextCAPTION
languagecpp
          DEF_CHK_VAL_MIN(val, val_min);


Arguments

val

Value to validate.

...

where N is the number of data word bits supported by the compiler and/or target environment. Note that the most negative value, -2^(N-1), is not included in the supported range since many compilers do not always correctly handle this value.

Example Usage

C++
Code Block
Language
CaptionTextCAPTION
languagecpp
          #define  CFG_VAL           -1
           
          #if     (DEF_CHK_VAL_MIN(CFG_VAL, 0u) != DEF_OK)  /* Signed CFG_VAL NOT promoted to unsigned. */
          #error  "CFG_VAL must be >= 0"
          #endif