9.18 Block scope function declarations

The compiler supports the following extensions to block scope function declarations.

  • A block-scope function declaration also declares the function name at file scope.

  • A block-scope function declaration can have static storage class, thereby causing the resulting declaration to have static linkage by default.

Examples

void f1(void)
{
    static void g(void); /* static function declared in local scope */
                         /* use of static keyword is illegal in strict ISO C */
}
void f2(void)
{
    g();                 /* uses previous local declaration */
}
static void g(int i)
{ } /* error - conflicts with previous declaration of g */
Non-ConfidentialPDF file icon PDF versionARM DUI0472J
Copyright © 2010-2013 ARM. All rights reserved.