[PATCH] D33676: Place implictly declared functions at block scope

Roger Ferrer Ibanez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 30 08:04:20 PDT 2017


rogfer01 added a comment.

I wonder what should we do in C99 for cases like

  void foo(void) {
  
    {
      extern void g(int(*a)[call_to_undeclared()]);
  
      int (*p_ok)() = call_to_undeclared;
    }
    int (*p_err)() = call_to_undeclared;
  }

I understand that the scope `S` in this case is a (function) prototype scope so it would not be the innermost block scope, would it? That said, GCC does not accept `p_ok` above so probably this behaviour is sensible, after all in C99 this is an extension.


https://reviews.llvm.org/D33676





More information about the cfe-commits mailing list