21-02-2019, 02:32 AM
Hello,
We have some doubts about Rule 21.3 and Rule 21.8, please help clarify
Rule 21.3 The memory allocation and deallocation functions of shall not be used
Rule 21.8 The library functions abort, exit, getenv and system of shall not be used
From the titles and Rationale of these two rules, they are talking about only functions with the forbidden identifiers, but in the Amplification of these two rules, all these identifiers and macros are forbidden including using these identifiers to define variables or fields of structs. So my question is that can we use these identifiers in the following cases:
Please help clarify, thanks a lot!
We have some doubts about Rule 21.3 and Rule 21.8, please help clarify
Rule 21.3 The memory allocation and deallocation functions of shall not be used
Rule 21.8 The library functions abort, exit, getenv and system of shall not be used
From the titles and Rationale of these two rules, they are talking about only functions with the forbidden identifiers, but in the Amplification of these two rules, all these identifiers and macros are forbidden including using these identifiers to define variables or fields of structs. So my question is that can we use these identifiers in the following cases:
Code:
int free = 0; //Violate Rule 21.3?
struct s {
int free; //Violate Rule 21.3?
int malloc; //Violate Rule 21.3?
int exit; //Violate Rule 21.8?
};
Please help clarify, thanks a lot!
<t></t>