https://bugs.llvm.org/show_bug.cgi?id=48672

            Bug ID: 48672
           Summary: Block scope function declaration with implicit int +
                    GNU attribute
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: C
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected],
                    [email protected], [email protected],
                    [email protected]

In the following in C89 mode, h() is treated as a function declaration with an
implicit int return type in GCC, but is rejected by Clang as an invalid
declaration:

```
__attribute__(()) g(); // Accepted by both Clang and GCC

void func(void) {
  __attribute__(()) h(); // Rejected by Clang, accepted by GCC
  __attribute__(()) extern i(); // Accepted by both Clang and GCC
  j(); // Function call expr to an implicitly-declared function j() in
       // both Clang and GCC.
}
```
GCC and Clang both use the presence of a GNU-style attribute to signal that
what follows is a declaration, but it seems that Clang's handling requires some
kind of declaration specifier (like the `extern` keyword) to get this correct
at block scope.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to