[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 113: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
MISRA Bulletin Board • Doubts about Rule 21.3 and 21.8
Page 1 of 1

Doubts about Rule 21.3 and 21.8

Posted: Thu Feb 21, 2019 2:32 am
by chenzhuowansui

Re: Doubts about Rule 21.3 and 21.8

Posted: Tue Feb 26, 2019 6:24 am
by chenzhuowansui

Re: Doubts about Rule 21.3 and 21.8

Posted: Wed Jun 12, 2019 8:27 am
by misra-c
Rule 21.3 restricts the use of the functions malloc etc: as defined in stdlib.h. The amplification recognises that malloc etc: may be implemented either as a function or as macro in stdlib.h. The same comment applies to rule 21.8. None of your examples violate rule 21.3 or rule 21.8.

However your examples do violate rule 21.2 as they are declarations of reserved identifiers. The Amplification of rule 21.1 (referred to in rule 21.2) includes in its list of reserved identifiers the "identifiers in file scope described in Section 7, Library" of The Standard. Rule 21.2 applies even if stdlib.h is not included.