All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sonar.l10n.java.rules.squid.S1314.html Maven / Gradle / Ivy

The newest version!

Integer literals starting with a zero are octal rather than decimal values. While using octal values is fully supported, most developers do not have experience with them. They may not recognize octal values as such, mistaking them instead for decimal values.

Noncompliant Code Example

int myNumber = 010;   // myNumber will hold 8, not 10 - was this really expected?

Compliant Solution

int myNumber = 8;

See (C/C++ only)

  • MISRA C:2004, 7.1 - Octal constants shall not be used
  • MISRA C++:2008, 2-13-2
  • MISRA C:2012, 7.1 - Octal constants shall not be used




© 2015 - 2025 Weber Informatics LLC | Privacy Policy