Also remove -pedantic-errors when using --ignore-compiler-warnings

Fixes #3584
This commit is contained in:
Kovid Goyal 2021-05-07 06:26:00 +05:30
parent baa8152248
commit bef4905416
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -301,14 +301,14 @@ def init_env(
cppflags = shlex.split(cppflags_)
for el in extra_logging:
cppflags.append('-DDEBUG_{}'.format(el.upper().replace('-', '_')))
werror = '' if ignore_compiler_warnings else '-Werror'
werror = '' if ignore_compiler_warnings else '-pedantic-errors -Werror'
std = '' if is_openbsd else '-std=c11'
sanitize_flag = ' '.join(sanitize_args)
march = '-march=native' if native_optimizations else ''
cflags_ = os.environ.get(
'OVERRIDE_CFLAGS', (
f'-Wextra {float_conversion} -Wno-missing-field-initializers -Wall -Wstrict-prototypes {std}'
f' -pedantic-errors {werror} {optimize} {sanitize_flag} -fwrapv {stack_protector} {missing_braces}'
f' {werror} {optimize} {sanitize_flag} -fwrapv {stack_protector} {missing_braces}'
f' -pipe {march} -fvisibility=hidden {fortify_source}'
)
)