Acceptable Escape Sequences?

6.4 Character Sets

Moderators: misra-c, david ward

gs
Posts: 87
Joined: Thu Nov 18, 2004 1:39 am

Acceptable Escape Sequences?

Postby gs » Fri Apr 25, 2008 2:24 pm

Hi,
Rule 4.1 states
Only those escape sequences that are defined in the ISO C standard shall be used.
The explanatory text then refers the Reader to section 5.2.2 of the C99 Standard for a list of escape sequences. However, 6.4.4.4 also defines an escape-sequence syntax as

Code: Select all

    escape-sequence:
       simple-escape-sequence
       octal-escape-sequence
       hexadecimal-escape-sequence
       universal-character-name

and a hexadecimal-escape-sequence as

Code: Select all

    hexadecimal-escape-sequence:
       \x hexadecimal-digit
       hexadecimal-escape-sequence hexadecimal-digit


The use of '\x' i not mentioned in 5.2.2 as a valid escape-sequence. Are hexadecimal escape-sequences permitted under MISRA 2004 Rule 4.1?

Lundin
Posts: 70
Joined: Mon Dec 10, 2007 1:57 pm

Re: Acceptable Escape Sequences?

Postby Lundin » Tue Apr 29, 2008 10:35 am

Hexadecimal is not allowed.

You will want to download the Technical Corrigendum 1, which clarifies rule 4.1, among other things.

gs
Posts: 87
Joined: Thu Nov 18, 2004 1:39 am

Re: Acceptable Escape Sequences?

Postby gs » Tue May 06, 2008 6:15 pm

Does this prohibition apply to MISRA C 1998, Rule 5, as well?

misra-c
Posts: 537
Joined: Thu Jan 05, 2006 1:11 pm

Re: Acceptable Escape Sequences?

Postby misra-c » Wed May 21, 2008 2:10 pm

MISRA-C 1998 has been superceded by MISRA-C 2004 as amended by TC1.

MISRA have no plans to provide further direction on MISRA-C 1998.

MISRA are offering no direction on how to apply subsequent changes to obsolete versions of the document.

Note: Both MISRA-C 1998 and MISRA-C 2004 & TC1 are based on the 1990 version of the C standard, and not the 1999 version.
---
Posted by and on behalf of
the MISRA C Working Group


Return to “6.4 Character Sets”

Who is online

Users browsing this forum: No registered users and 1 guest