File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1518,6 +1518,7 @@ class db_found(Exception): pass
15181518 if '--with-system-expat' in sysconfig .get_config_var ("CONFIG_ARGS" ):
15191519 expat_inc = []
15201520 define_macros = []
1521+ extra_compile_args = []
15211522 expat_lib = ['expat' ]
15221523 expat_sources = []
15231524 expat_depends = []
@@ -1529,6 +1530,7 @@ class db_found(Exception): pass
15291530 # call XML_SetHashSalt(), expat entropy sources are not needed
15301531 ('XML_POOR_ENTROPY' , '1' ),
15311532 ]
1533+ extra_compile_args = []
15321534 expat_lib = []
15331535 expat_sources = ['expat/xmlparse.c' ,
15341536 'expat/xmlrole.c' ,
@@ -1546,8 +1548,15 @@ class db_found(Exception): pass
15461548 'expat/xmltok_impl.h'
15471549 ]
15481550
1551+ cc = sysconfig .get_config_var ('CC' ).split ()[0 ]
1552+ ret = os .system (
1553+ '"%s" -Werror -Wimplicit-fallthrough -E -xc /dev/null >/dev/null 2>&1' % cc )
1554+ if ret >> 8 == 0 :
1555+ extra_compile_args .append ('-Wno-implicit-fallthrough' )
1556+
15491557 exts .append (Extension ('pyexpat' ,
15501558 define_macros = define_macros ,
1559+ extra_compile_args = extra_compile_args ,
15511560 include_dirs = expat_inc ,
15521561 libraries = expat_lib ,
15531562 sources = ['pyexpat.c' ] + expat_sources ,
You can’t perform that action at this time.
0 commit comments