static function prototype

6.8 Declarations and Definitions

Moderators: misra-c, david ward

Posts: 1
Joined: Thu Sep 30, 2004 1:22 pm
Location: Brussels

static function prototype

Post by bpereira » Wed Jan 11, 2006 9:32 am

The specification isn't clear about static function, should they have prototype or not ?

The rule talk about declaration in header file, of course this isn't applicable to static function. So it sound to me that static function should not have prototype.

Posts: 9
Joined: Mon Nov 15, 2004 6:44 am

Post by bmerkle » Wed Jan 18, 2006 3:58 pm

i think MISRA is clear in this point:

page 31 states under Rule 8.1 as a hint:
\"The provision of a prototype fro a function with internal linkage is a good programming pratice\"

page 32 states under Rule 8.6: Functions shall be declared at file scope.
So this concerns both, external (in header) and internal (in c source) IMO.

also Rule 8.10 on page 33

kind regards,

Posts: 572
Joined: Thu Jan 05, 2006 1:11 pm

Post by misra-c » Thu Apr 27, 2006 2:35 pm

All functions shall have a prototype.
Posted by and on behalf of
the MISRA C Working Group


Return to “6.8 Declarations and Definitions”