[previous] 3491 [next] Using conditional operator in a macro.
Arithmetic type - Operations

This message is issued whenever the conditional operator appears in a macro. This is not recommended in some programming standards.

For example:


/*PRQA S 1-9999 ++*/
/*PRQA S 3491 --*/

#define SELECT(a, b, c) ((a) ? (b) : (c))

int f3491 (int a)
{
  return SELECT (a < 0, 0, a);   /* 3491 */
}

See also:

QA·C Source Code Analyser 8.1.2
© 2013 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index Contents