אנונימי
אנונימי

Reputation: 332

How to fix "The input/output library <stdio.h> shall not be used."

Rule 22 in JSF AV C++ Coding Standards says:

AV Rule 22 (MISRA Rule 124, Revised)

The input/output library <stdio.h> shall not be used.

I understand from this answer why I shouldn't use these functions, but so far I didn't find an answer to what I can do instead? What if I need to print to console or to some other buffer?

Upvotes: -1

Views: 531

Answers (1)

Andrew
Andrew

Reputation: 2322

The JSF AV guidance (which was based on MISRA C:1998) includes similar provision to MISRA's deviation process, allowing violation of a rule if appropriate... this is detailed in AV Rules 4 through 7.

This requires approval from the software engineering lead.

But as Jonathan notes in the comments on the original post, I'm not quite sure where you want to printf() to on an avionics assembly.

If you happen to have a separate debug port/console, then you'll probably need to roll-your-own I/O function anyway.

Upvotes: 0

Related Questions