mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 14:06:16 +02:00
enable -Werror=unused-result
Inspired by
010ff57ebb
From the original PR:
> We do not have any of these warnings appearing at the moment, but
> it seems like a good idea to enable [[nodiscard]] checking anyway.
> Once we start introducing more functions with must-use conditions we will
> need such checking, and the rust stdlib has proven them very useful.
This commit is contained in:
parent
80d67d603b
commit
101915c9b7
8 changed files with 11 additions and 2 deletions
2
Makefile
2
Makefile
|
@ -92,7 +92,7 @@ ifdef HOST_WINDOWS
|
||||||
GLOBAL_LDFLAGS += -Wl,--export-all-symbols
|
GLOBAL_LDFLAGS += -Wl,--export-all-symbols
|
||||||
endif
|
endif
|
||||||
|
|
||||||
GLOBAL_CXXFLAGS += -g -Wall -Wdeprecated-copy -Wignored-qualifiers -Wimplicit-fallthrough -include $(buildprefix)config.h -std=c++2a -I src
|
GLOBAL_CXXFLAGS += -g -Wall -Wdeprecated-copy -Wignored-qualifiers -Wimplicit-fallthrough -Werror=unused-result -include $(buildprefix)config.h -std=c++2a -I src
|
||||||
|
|
||||||
# Include the main lib, causing rules to be defined
|
# Include the main lib, causing rules to be defined
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,7 @@ add_project_arguments(
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Werror=switch',
|
'-Werror=switch',
|
||||||
'-Werror=switch-enum',
|
'-Werror=switch-enum',
|
||||||
|
'-Werror=unused-result',
|
||||||
'-Wdeprecated-copy',
|
'-Wdeprecated-copy',
|
||||||
'-Wignored-qualifiers',
|
'-Wignored-qualifiers',
|
||||||
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
||||||
|
|
|
@ -164,6 +164,7 @@ add_project_arguments(
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Werror=switch',
|
'-Werror=switch',
|
||||||
'-Werror=switch-enum',
|
'-Werror=switch-enum',
|
||||||
|
'-Werror=unused-result',
|
||||||
'-Wdeprecated-copy',
|
'-Wdeprecated-copy',
|
||||||
'-Wignored-qualifiers',
|
'-Wignored-qualifiers',
|
||||||
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
||||||
|
|
|
@ -34,6 +34,7 @@ add_project_arguments(
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Werror=switch',
|
'-Werror=switch',
|
||||||
'-Werror=switch-enum',
|
'-Werror=switch-enum',
|
||||||
|
'-Werror=unused-result',
|
||||||
'-Wdeprecated-copy',
|
'-Wdeprecated-copy',
|
||||||
'-Wignored-qualifiers',
|
'-Wignored-qualifiers',
|
||||||
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
||||||
|
|
|
@ -143,6 +143,7 @@ add_project_arguments(
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Werror=switch',
|
'-Werror=switch',
|
||||||
'-Werror=switch-enum',
|
'-Werror=switch-enum',
|
||||||
|
'-Werror=unused-result',
|
||||||
'-Wdeprecated-copy',
|
'-Wdeprecated-copy',
|
||||||
'-Wignored-qualifiers',
|
'-Wignored-qualifiers',
|
||||||
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
||||||
|
|
|
@ -23,11 +23,14 @@ nix_perl_conf.set('PACKAGE_VERSION', meson.project_version())
|
||||||
# set error arguments
|
# set error arguments
|
||||||
#-------------------------------------------------
|
#-------------------------------------------------
|
||||||
error_args = [
|
error_args = [
|
||||||
|
'-Werror=unused-result',
|
||||||
|
'-Wdeprecated-copy',
|
||||||
|
'-Wdeprecated-declarations',
|
||||||
|
'-Wignored-qualifiers',
|
||||||
'-Wno-pedantic',
|
'-Wno-pedantic',
|
||||||
'-Wno-non-virtual-dtor',
|
'-Wno-non-virtual-dtor',
|
||||||
'-Wno-unused-parameter',
|
'-Wno-unused-parameter',
|
||||||
'-Wno-variadic-macros',
|
'-Wno-variadic-macros',
|
||||||
'-Wdeprecated-declarations',
|
|
||||||
'-Wno-missing-field-initializers',
|
'-Wno-missing-field-initializers',
|
||||||
'-Wno-unknown-warning-option',
|
'-Wno-unknown-warning-option',
|
||||||
'-Wno-unused-variable',
|
'-Wno-unused-variable',
|
||||||
|
|
|
@ -28,6 +28,7 @@ add_project_arguments(
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Werror=switch',
|
'-Werror=switch',
|
||||||
'-Werror=switch-enum',
|
'-Werror=switch-enum',
|
||||||
|
'-Werror=unused-result',
|
||||||
'-Wdeprecated-copy',
|
'-Wdeprecated-copy',
|
||||||
'-Wignored-qualifiers',
|
'-Wignored-qualifiers',
|
||||||
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
||||||
|
|
|
@ -34,6 +34,7 @@ add_project_arguments(
|
||||||
'-Wimplicit-fallthrough',
|
'-Wimplicit-fallthrough',
|
||||||
'-Werror=switch',
|
'-Werror=switch',
|
||||||
'-Werror=switch-enum',
|
'-Werror=switch-enum',
|
||||||
|
'-Werror=unused-result',
|
||||||
'-Wdeprecated-copy',
|
'-Wdeprecated-copy',
|
||||||
'-Wignored-qualifiers',
|
'-Wignored-qualifiers',
|
||||||
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
# Enable assertions in libstdc++ by default. Harmless on libc++. Benchmarked
|
||||||
|
|
Loading…
Reference in a new issue