linux/scripts/gcc-plugins
Kees Cook 8d97fb393c gcc-plugins/stackleak: Avoid assignment for unused macro argument
With GCC version >= 8, the cgraph_create_edge() macro argument using
"frequency" goes unused. Instead of assigning a temporary variable for
the argument, pass the compute_call_stmt_bb_frequency() call directly
as the macro argument so that it will just not be called when it is
not wanted by the macros.

Silences the warning:

scripts/gcc-plugins/stackleak_plugin.c:54:6: warning: variable ‘frequency’ set but not used [-Wunused-but-set-variable]

Now builds cleanly with gcc-7 and gcc-9. Both boot and pass
STACKLEAK_ERASING LKDTM test.

Signed-off-by: Kees Cook <keescook@chromium.org>
2020-04-13 10:17:44 -07:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
arm_ssp_per_task_plugin.c gcc-plugins: arm_ssp_per_task_plugin: Fix for older GCC < 6 2019-05-10 15:35:01 -07:00
cyc_complexity_plugin.c gcc-plugins: consolidate on PASS_INFO macro 2017-01-13 14:20:03 -08:00
gcc-common.h gcc-plugins: Fix build failures under Darwin host 2019-05-20 13:30:54 -07:00
gcc-generate-gimple-pass.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-generate-ipa-pass.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-generate-rtl-pass.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gcc-generate-simple_ipa-pass.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
gen-random-seed.sh License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
Kconfig gcc-plugins: drop support for GCC <= 4.7 2020-04-09 00:13:45 +09:00
latent_entropy_plugin.c gcc-plugins: Use dynamic initializers 2018-02-05 17:27:46 -08:00
Makefile gcc-plugins: drop support for GCC <= 4.7 2020-04-09 00:13:45 +09:00
randomize_layout_plugin.c randstruct: Check member structs in is_pure_ops_struct() 2019-07-31 13:13:22 -07:00
sancov_plugin.c gcc-plugins: fix sancov_plugin for gcc-5 2017-02-27 14:10:10 -08:00
stackleak_plugin.c gcc-plugins/stackleak: Avoid assignment for unused macro argument 2020-04-13 10:17:44 -07:00
structleak_plugin.c gcc-plugins: structleak: Generalize to all variable types 2019-03-04 09:29:41 -08:00