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

Function check_gcc_function_attribute

numpy/distutils/command/autodist.py:90–108  ·  view source on GitHub ↗

Return True if the given function attribute is supported.

(cmd, attribute, name)

Source from the content-addressed store, hash-verified

88
89
90def check_gcc_function_attribute(cmd, attribute, name):
91 """Return True if the given function attribute is supported."""
92 cmd._check_compiler()
93 body = textwrap.dedent("""
94 #pragma GCC diagnostic error "-Wattributes"
95 #pragma clang diagnostic error "-Wattributes"
96
97 int %s %s(void* unused)
98 {
99 return 0;
100 }
101
102 int
103 main()
104 {
105 return 0;
106 }
107 """) % (attribute, name)
108 return cmd.try_compile(body, None, None) != 0
109
110
111def check_gcc_function_attribute_with_intrinsics(cmd, attribute, name, code,

Callers 1

Calls 1

_check_compilerMethod · 0.80

Tested by

no test coverage detected