Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
about rule20_5
#1
void func()
{
int errno;//does even declaration of errno violates rule20_5,errno is user defined?
}
<t></t>
Reply
#2
Manisha Nikambe Wrote:void func()
{
int errno;//does even declaration of errno violates rule20_5,errno is user defined?
}

YES. It is that simple. You can not use "errno"

In any event rule 20.5 does not apply here. You are not useing errno. You are using your own version. The rule that does apply here is 20.1 "Reserved identifiers, macros and functions inthe standard library shall not be defined, redefined or undefined."

[ removed by moderator ]
Reply
#3
The previous poster is not quite correct. Defining your own version of errno does not violate Rule 20.5. However, reusing any identifiers reserved for use by the standard library does violate Rule 20.2 (note, not Rule 20.1 as stated by the previous poster which prohibits redefinition using macros).
Posted by and on behalf of the MISRA C Working Group
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)