compilers/c_function_attributes: fix for ICC

ICC doesn't like the extra set of parens, GCC 8.2.1 and Clang 6.0.1
don't have a problem with this.
pull/4359/head
Dylan Baker 6 years ago
parent 80f8c9930c
commit 21a7528b2f
  1. 8
      mesonbuild/compilers/c_function_attributes.py
  2. 4
      test cases/common/204 function attributes/meson.build

@ -91,10 +91,10 @@ C_FUNC_ATTRIBUTES = {
'used':
'int foo(void) __attribute__((used));',
'visibility': '''
int foo_def(void) __attribute__((visibility(("default"))));
int foo_hid(void) __attribute__((visibility(("hidden"))));
int foo_int(void) __attribute__((visibility(("internal"))));
int foo_pro(void) __attribute__((visibility(("protected"))));''',
int foo_def(void) __attribute__((visibility("default")));
int foo_hid(void) __attribute__((visibility("hidden")));
int foo_int(void) __attribute__((visibility("internal")));
int foo_pro(void) __attribute__((visibility("protected")));''',
'warning':
'int foo(void) __attribute__((warning("")));',
'warn_unused_result':

@ -63,7 +63,7 @@ if host_machine.system() != 'darwin'
attributes += 'visibility'
endif
if c.get_id() == 'gcc'
if ['gcc', 'intel'].contains(c.get_id())
# not supported by clang as of 5.0.0 (at least up to 6.0.1)
attributes += 'artificial'
attributes += 'error'
@ -73,7 +73,7 @@ if c.get_id() == 'gcc'
attributes += 'optimize'
attributes += 'warning'
if c.version().version_compare('>= 7.0.0')
if c.get_id() == 'gcc' and c.version().version_compare('>= 7.0.0')
attributes += 'fallthrough'
endif
endif

Loading…
Cancel
Save