If we build with -Werror=implicit-function-declaration, only implicit function declarations of non-library functions throw compiler errors. For library functions, we only produce a warning. There is no way to promote both of these cases to an error without promoting other warnings. It makes little sense to introduce an additional compiler flag just to control this specific warning. In my opinion it should just be part of the same group. llvm-svn: 246857
11 lines
714 B
C
11 lines
714 B
C
// RUN: %clang -target x86_64-apple-darwin -mios-simulator-version-min=7 -fsyntax-only %s -Xclang -verify
|
|
// RUN: %clang -target x86_64-apple-darwin -arch arm64 -target x86_64-apple-darwin -mios-version-min=7 -fsyntax-only %s -Xclang -verify
|
|
|
|
// For 64-bit iOS, automatically promote -Wimplicit-function-declaration
|
|
// to an error.
|
|
|
|
void radar_10894044() {
|
|
printf("Hi\n"); // expected-error {{implicitly declaring library function 'printf' with type 'int (const char *, ...)'}} expected-note {{include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
|
|
radar_10894044_not_declared(); // expected-error {{implicit declaration of function 'radar_10894044_not_declared' is invalid in C99}}
|
|
}
|