forked from OSchip/llvm-project
7d644e1215
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 |
||
---|---|---|
.. | ||
ContinuousSyncMode | ||
Darwin | ||
Inputs | ||
Linux | ||
Posix | ||
Windows | ||
CMakeLists.txt | ||
coverage-inline.cpp | ||
coverage_comments.cpp | ||
coverage_emptylines.cpp | ||
gcc-flag-compatibility.test | ||
gcov-__gcov_flush-terminate.c | ||
gcov-basic.c | ||
gcov-complex-line.c | ||
gcov-dump-and-remove.c | ||
infinite_loop.c | ||
instrprof-basic.c | ||
instrprof-bufferio.c | ||
instrprof-coverage.c | ||
instrprof-darwin-dead-strip.c | ||
instrprof-darwin-exports.c | ||
instrprof-dump.c | ||
instrprof-error.c | ||
instrprof-gc-sections.c | ||
instrprof-gcov-exceptions.test | ||
instrprof-gcov-multiple-bbs-single-line.test | ||
instrprof-gcov-multithread_fork.test | ||
instrprof-gcov-one-line-function.test | ||
instrprof-gcov-switch.test | ||
instrprof-gcov-two-objects.test | ||
instrprof-get-filename.c | ||
instrprof-hostname.c | ||
instrprof-icall-promo.test | ||
instrprof-lto-pgogen.c | ||
instrprof-merge-entry-cover.c | ||
instrprof-merge-match.test | ||
instrprof-merge.c | ||
instrprof-merging.cpp | ||
instrprof-order-file.test | ||
instrprof-override-filename-then-reset-default.c | ||
instrprof-override-filename-with-env.c | ||
instrprof-override-filename.c | ||
instrprof-path.c | ||
instrprof-reset-counters.c | ||
instrprof-set-dir-mode.c | ||
instrprof-set-file-object-merging.c | ||
instrprof-set-file-object.c | ||
instrprof-set-filename-then-reset-default.c | ||
instrprof-set-filename.c | ||
instrprof-tmpdir.c | ||
instrprof-value-prof-2.c | ||
instrprof-value-prof-evict.test | ||
instrprof-value-prof-reset.c | ||
instrprof-value-prof.c | ||
instrprof-value-prof.test | ||
instrprof-version-mismatch.c | ||
instrprof-without-libc.c | ||
instrprof-write-buffer-internal.c | ||
instrprof-write-file-atexit-explicitly.c | ||
instrprof-write-file-only.c | ||
instrprof-write-file.c | ||
lit.cfg.py | ||
lit.site.cfg.py.in | ||
profile_test.h | ||
runtime_infinite.c |