Did '\000' and 000 comply with Rule 2-13-2

Moderators: david ward, misra cpp

Post Reply
longfem
Posts: 1
Joined: Thu Feb 23, 2017 9:07 am
Company: Synopsys

Did '\000' and 000 comply with Rule 2-13-2

Post by longfem » Tue Feb 28, 2017 6:09 am

Dears,
Rule 2-10-3 said that Octal constants (other than zero) and octal escape sequences (other than “\0”) shall not be used.

From the description we know that '\0' and 0 comply with the rule.
How about '\00', '\000' , 00 and 000 ?

Thanks,
Longfem

misra cpp
Posts: 150
Joined: Mon Jun 02, 2008 1:55 pm
Company: MISRA

Re: Did '\000' and 000 comply with Rule 2-13-2

Post by misra cpp » Mon Jul 10, 2017 10:59 am

As written 00 and 000 are compliant, whilst \00 and \000 are non-compliant. This is not a particularly sensible position, so will be reviewed for the next version
Posted by and on behalf of
the MISRA C++ Working Group

Post Reply

Return to “6.2 Lexical conventions (C++)”