Skip to content

Commit e106dcc

Browse files
committed
Dont use -Wfloat-conversion on old compilers
1 parent 9347be6 commit e106dcc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

setup.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,10 @@ def init_env(
200200
if ccver < (5, 2) and cc == 'gcc':
201201
missing_braces = '-Wno-missing-braces'
202202
df = '-g3'
203+
float_conversion = ''
203204
if ccver >= (5, 0):
204205
df += ' -Og'
206+
float_conversion = '-Wfloat-conversion'
205207
optimize = df if debug or sanitize else '-O3'
206208
sanitize_args = get_sanitize_args(cc, ccver) if sanitize else set()
207209
cppflags = os.environ.get(
@@ -212,9 +214,10 @@ def init_env(
212214
cppflags.append('-DDEBUG_{}'.format(el.upper().replace('-', '_')))
213215
cflags = os.environ.get(
214216
'OVERRIDE_CFLAGS', (
215-
'-Wextra -Wfloat-conversion -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11'
217+
'-Wextra {} -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11'
216218
' -pedantic-errors -Werror {} {} -fwrapv {} {} -pipe {} -fvisibility=hidden'
217219
).format(
220+
float_conversion,
218221
optimize,
219222
' '.join(sanitize_args),
220223
stack_protector,

0 commit comments

Comments
 (0)