llvm-project/compiler-rt/test/dfsan
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 [DFSan] Add option for conditional callbacks. 2022-01-05 15:07:09 -08:00
CMakeLists.txt
atomic.cpp [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
basic.c [DFSan] Remove -dfsan-args-abi support in favor of TLS. 2021-10-08 11:18:36 -07:00
conditional_callbacks.c [DFSan] Add option for conditional callbacks. 2022-01-05 15:07:09 -08:00
conditional_callbacks_sig.c [DFSan] Add option for conditional callbacks. 2022-01-05 15:07:09 -08:00
custom.cpp [DFSan] Fix several bugs in dfsan custom callbacks test. 2022-03-08 14:26:28 -08:00
dfsan_get_track_origins.c [dfsan] Expose dfsan_get_track_origins to get origin tracking status 2021-06-29 20:32:39 +00:00
event_callbacks.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
fast8labels.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
flags.c [dfsan] Make warn_unimplemented off by default 2021-07-22 21:45:41 +00:00
flush.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
fncall.c [DFSan] Remove -dfsan-args-abi support in favor of TLS. 2021-10-08 11:18:36 -07:00
force_zero.c [DFSan] Add force_zero_label abilist option to DFSan. This can be used as a work-around for overtainting. 2021-09-17 12:57:40 -07:00
fork.cpp [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
gep.c [dfsan] Add a flag about whether to propagate offset labels at gep 2021-05-28 00:06:19 +00:00
interceptors.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
lit.cfg.py [dfsan] Re-enable origin tracking test cases 2021-03-06 02:41:56 +00:00
lit.site.cfg.py.in
lookup_table.c [DFSan] Add dfsan-combine-taint-lookup-table option as work around for 2022-04-05 11:05:10 -07:00
mmap_at_init.c [C11/C2x] Change the behavior of the implicit function declaration warning 2022-04-20 11:30:12 -04:00
origin_add_label.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_branch.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_disabled.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_id_stack_trace.c [DFSan] Add functions to print origin trace from origin id instead of address. 2021-12-22 16:45:54 -08:00
origin_invalid.c [DFSan] Change shadow and origin memory layouts to match MSan. 2021-06-25 17:00:38 -07:00
origin_ld_lost.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_ldst.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_limit.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_memcpy.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
origin_memmove.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
origin_memset.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_of_first_taint.c [DFSan] Make dfsan_read_origin_of_first_taint public. 2021-12-22 23:45:30 -08:00
origin_overlapped.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_set_label.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_stack_trace.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
origin_track_ld.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
origin_unaligned_memtrans.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
origin_untainted.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
origin_with_sigactions.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
origin_with_signals.cpp [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
pair.cpp [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
propagate.c [DFSan] Remove -dfsan-args-abi support in favor of TLS. 2021-10-08 11:18:36 -07:00
pthread.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
release_shadow_space.c [DFSan] Remove use of setarch in dfsan test. 2022-03-14 10:03:51 -07:00
sigaction.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
sigaction_stress_test.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
stack_trace.c [dfsan] Replace dfs$ prefix with .dfsan suffix 2021-06-17 22:42:47 -07:00
struct.c [dfsan] Add full fast8 support 2021-06-07 17:20:54 -07:00
threaded_flush.c [dfsan] Turn off all dfsan test cases on non x86_64 OSs 2021-05-05 05:30:53 +00:00
trace-cmp.c [dfsan] Turn off all dfsan test cases on non x86_64 OSs 2021-05-05 05:30:53 +00:00
vararg.c [DFSan] Remove -dfsan-args-abi support in favor of TLS. 2021-10-08 11:18:36 -07:00
write_callback.c [DFSan] Remove -dfsan-args-abi support in favor of TLS. 2021-10-08 11:18:36 -07:00