Abraxas/CCS  Home  Table of Contents

Module - 31.html

ABRAXAS SOFTWARE - CodeCheck CCS Test-Suite

CCS -C Test Suite for Module - 31.cpp

// 31) Don't write code that depends on the order of evaluation of function arguments.

int pow31( int, int );

// bad 31, don't return side-effect




Function Name: inc31()

int inc31( int &x ) { return ++x; }
int



Function Name: f31()

f31( ) {
 int k=1;

// bad 31, don't call with multiple side-effect on same object

 k = pow31( ++k, ++k ) ;
 k = pow31( inc31(k),inc31(k) );
 return k ;
 }

Abraxas/CCS  Home  Table of Contents

ABRAXAS SOFTWARE - CodeCheck CCS Test-Suite CCS