[previous] 0339 [next] Octal constant used.
Constants

An octal constant has been used.

Octal constants are distinguished from decimal constants by having a leading zero. They are often prohibited in programming standards because they can so easily be misinterpreted. The constant zero, 0, although technically an octal constant, is considered an exception to this rule.

For example:


/*PRQA S 2017,3120,3211,3408 ++*/

#define MZER 0
#define MASK 0160                       /* Message 0336 */

int g1 = 0;
int g2 = 0123;                          /* Message 0339 */



MISRA-C:2004 Rules applicable to message 0339:

Rule  7.1  (Required) Octal constants (other than zero) and octal escape sequences shall not be used.


See also:

QA·C Source Code Analyser 8.1
MISRA-C:2004 Compliance Module 3.2
© 2012 Programming Research.
www.programmingresearch.com
Personality Groups | Glossary | Message Index | MISRA-C:2004 Rule Index Contents