Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does this code violate rule #8.7?
#2
The code fragment in file1.c needs a little more context in order to answer the question.

Is the intention that the definition of j occur outside of any block?

The initialisation of j seems to violate constraints because initialisers for objects with static storage duration must be constant expressions.

Please could you amend the example?
Posted by and on behalf of the MISRA C Working Group
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)