Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: changes to examples to comply with coding guidelines

...

Code Block
bgColor#ffcccc
langc
#include <limits.h>
 
void func(float f_a) {
  int i_a;
 
  /* Undefined if the integral part of f_a >= INT_MAX */
  i_a = f_a;
}

...

Code Block
bgColor#ccccff
langc
#include <float.h>
#include <limits.h>
 
void func(float f_a) {
  int i_a;

  if (f_a >= ((float)INT_MAX -1.0) || f_a < ((float)INT_MIN +1.0)|| (f_a >= 0.0F && f_a < FLT_MIN)) {
    /* Handle error */
  } else {
    i_a = f_a;
  }
}

...