diff options
Diffstat (limited to 'numpy/distutils/command/autodist.py')
-rw-r--r-- | numpy/distutils/command/autodist.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/distutils/command/autodist.py b/numpy/distutils/command/autodist.py index ec00bcbdb..8598b33e6 100644 --- a/numpy/distutils/command/autodist.py +++ b/numpy/distutils/command/autodist.py @@ -59,6 +59,23 @@ main() """ % (attribute, name) return cmd.try_compile(body, None, None) != 0 +def check_gcc_variable_attribute(cmd, attribute): + """Return True if the given variable attribute is supported.""" + cmd._check_compiler() + body = """ +#pragma GCC diagnostic error "-Wattributes" +#pragma clang diagnostic error "-Wattributes" + +int %s foo; + +int +main() +{ + return 0; +} +""" % (attribute, ) + return cmd.try_compile(body, None, None) != 0 + def check_compile_without_warning(cmd, body): cmd._check_compiler() ret, output = cmd.try_output_compile(body, None, None) |