MCPcopy Create free account
hub / github.com/numpy/numpy / check_gcc_variable_attribute

Function check_gcc_variable_attribute

numpy/distutils/command/autodist.py:133–148  ·  view source on GitHub ↗

Return True if the given variable attribute is supported.

(cmd, attribute)

Source from the content-addressed store, hash-verified

131
132
133def check_gcc_variable_attribute(cmd, attribute):
134 """Return True if the given variable attribute is supported."""
135 cmd._check_compiler()
136 body = textwrap.dedent("""
137 #pragma GCC diagnostic error "-Wattributes"
138 #pragma clang diagnostic error "-Wattributes"
139
140 int %s foo;
141
142 int
143 main()
144 {
145 return 0;
146 }
147 """) % (attribute, )
148 return cmd.try_compile(body, None, None) != 0

Callers 1

Calls 1

_check_compilerMethod · 0.80

Tested by

no test coverage detected