sei_cert_c_coding_standard

This is an old revision of the document!


An unsafe function-like macro is one whose expansion results in evaluating one of its parameters more than once or not at all.

#define ABS(x) (((x) < 0) ? -(x) : (x)) /* UNSAFE */
  
void func(int n) {
  /* Validate that n is within the desired range */
  ++n;
  int m = ABS(n);
 
  /* ... */
}
  • sei_cert_c_coding_standard.1565125441.txt.gz
  • Last modified: 2019/08/06 21:04
  • by rpjday