Bug #1200
various modules declare static functions within function bodies
100%
Description
It is, apparently, non-sensical to place a static function prototype within the body of a function, though Studio and GCC have supported it.
They should be pulled up to file scope.
Updated by Alan Coopersmith over 9 years ago
I believe placing function prototypes in the body of functions is technically legal C, but strongly discouraged as bad style, as it leads to prototypes being out of sync in different files. gcc similarly warns about non-static functions for which prototypes are not found from a common header file to avoid issues from prototype proliferation in calling sources.
Updated by Rich Lowe over 9 years ago
Putting prototypes in function bodies is certainly tasteless, but declaring them static is bogus: if the compiler supports nested functions as an extension, 'static' and it being declared within a function will specify conflicting scope; and possibly bogus in general -- I'm not certain what the standards say about the scope of a prototype declared within a function body, regardless of the nested-functions extension.
Updated by Rich Lowe over 9 years ago
- Status changed from In Progress to Resolved
- % Done changed from 80 to 100
Resolved in r13404 commit:4a1868d4ae91