llvm-project/clang/test/ARCMT
Aaron Ballman 7d644e1215 [C11/C2x] Change the behavior of the implicit function declaration warning
C89 had a questionable feature where the compiler would implicitly
declare a function that the user called but was never previously
declared. The resulting function would be globally declared as
extern int func(); -- a function without a prototype which accepts zero
or more arguments.

C99 removed support for this questionable feature due to severe
security concerns. However, there was no deprecation period; C89 had
the feature, C99 didn't. So Clang (and GCC) both supported the
functionality as an extension in C99 and later modes.

C2x no longer supports that function signature as it now requires all
functions to have a prototype, and given the known security issues with
the feature, continuing to support it as an extension is not tenable.

This patch changes the diagnostic behavior for the
-Wimplicit-function-declaration warning group depending on the language
mode in effect. We continue to warn by default in C89 mode (due to the
feature being dangerous to use). However, because this feature will not
be supported in C2x mode, we've diagnosed it as being invalid for so
long, the security concerns with the feature, and the trivial
workaround for users (declare the function), we now default the
extension warning to an error in C99-C17 mode. This still gives users
an easy workaround if they are extensively using the extension in those
modes (they can disable the warning or use -Wno-error to downgrade the
error), but the new diagnostic makes it more clear that this feature is
not supported and should be avoided. In C2x mode, we no longer allow an
implicit function to be defined and treat the situation the same as any
other lookup failure.

Differential Revision: https://reviews.llvm.org/D122983
2022-04-20 11:30:12 -04:00
..
Inputs
allowlisted [clang] [Objective C] Inclusive language: use objcmt-allowlist-dir-path=<arg> instead of objcmt-white-list-dir-path=<arg> 2021-11-05 12:27:05 -04:00
designated-init-in-header
Common.h
GC-check-warn-nsalloc.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
GC-check.m
GC-no-arc-runtime.m
GC-no-arc-runtime.m.result
GC-no-finalize-removal.m
GC-no-finalize-removal.m.result
GC.h
GC.m
GC.m.result
api.m
api.m.result
assign-prop-no-arc-runtime.m
assign-prop-no-arc-runtime.m.result
assign-prop-with-arc-runtime.m
assign-prop-with-arc-runtime.m.result
atautorelease-2.m
atautorelease-2.m.result
atautorelease-3.m
atautorelease-3.m.result
atautorelease-check.m
atautorelease.m
atautorelease.m.result
autoreleases.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
autoreleases.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
block_copy_release.m
block_copy_release.m.result
check-api.m
check-with-pch.m
check-with-serialized-diag.m
checking-in-arc.m
checking.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
cxx-checking.mm Recommit: Compress formatting of array type names (int [4] -> int[4]) 2021-10-21 11:34:43 -07:00
cxx-rewrite.mm
cxx-rewrite.mm.result
dealloc.m
dealloc.m.result
dispatch.m
dispatch.m.result
driver-migrate.m
init.m
init.m.result
lit.local.cfg
migrate-emit-errors.m
migrate-on-pch-and-module.m
migrate-plist-output.m
migrate-space-in-path.m
migrate-with-pch.m
migrate.m
no-canceling-bridge-to-bridge-cast.m
nonobjc-to-objc-cast-2.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
nonobjc-to-objc-cast.m
nonobjc-to-objc-cast.m.result
objcmt-arc-cf-annotations.m [C11/C2x] Change the behavior of the implicit function declaration warning 2022-04-20 11:30:12 -04:00
objcmt-arc-cf-annotations.m.result [C11/C2x] Change the behavior of the implicit function declaration warning 2022-04-20 11:30:12 -04:00
objcmt-atomic-property.m
objcmt-atomic-property.m.result
objcmt-boxing.m
objcmt-boxing.m.result
objcmt-designated-initializer.m
objcmt-designated-initializer.m.result
objcmt-instancetype-2.m
objcmt-instancetype-2.m.result
objcmt-instancetype-unnecessary-diff.m
objcmt-instancetype.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-instancetype.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-invalid-code.mm
objcmt-invalid-code.mm.result
objcmt-migrate-all.m
objcmt-migrate-all.m.result
objcmt-ns-enum-crash.m
objcmt-ns-enum-crash.m.result
objcmt-ns-macros.m
objcmt-ns-macros.m.result
objcmt-ns-nonatomic-iosonly.m
objcmt-ns-nonatomic-iosonly.m.result
objcmt-ns-returns-inner-pointer.m
objcmt-ns-returns-inner-pointer.m.result
objcmt-numeric-literals.m
objcmt-numeric-literals.m.result
objcmt-property-availability.m
objcmt-property-availability.m.result
objcmt-property-dot-syntax.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-property-dot-syntax.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-property.m
objcmt-property.m.result
objcmt-protocol-conformance.m
objcmt-protocol-conformance.m.result
objcmt-subscripting-literals-in-arc.m
objcmt-subscripting-literals-in-arc.m.result
objcmt-subscripting-literals.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-subscripting-literals.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-subscripting-unavailable.m
objcmt-subscripting-unavailable.m.result
objcmt-undefined-ns-macros.m
objcmt-undefined-ns-macros.m.result
objcmt-with-pch.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
objcmt-with-pch.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
protected-scope.m
protected-scope.m.result
releases-driver.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
releases-driver.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
releases.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
releases.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
remap-applying.c
remap-applying.c.result
remove-dealloc-method.m
remove-dealloc-method.m.result
remove-dealloc-zerouts.m
remove-dealloc-zerouts.m.result
remove-statements.m
remove-statements.m.result
retains.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
retains.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
rewrite-block-var.m Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
rewrite-block-var.m.result Use functions with prototypes when appropriate; NFC 2022-02-17 15:33:50 -05:00
safe-arc-assign.m
safe-arc-assign.m.result
verify.m
with-arc-mode-modify.m
with-arc-mode-modify.m.result