GCC won't emit a warning if we also use the inline keyword.
incr n -1
}
- # We have to turn off -Wattributes because some C subtests use the
- # ((always_inline)) attribute, which emits a warning
set res [target_compile [concat $sources] ${test} \
- executable "additional_flags=-O additional_flags=-g \
- additional_flags=-Wno-attributes"]
+ executable "additional_flags=-O additional_flags=-g"]
if { $res != "" } { return 1 }
return 0
}
// can't be too simple either, otherwise we won't even have an inline instance.
__attribute__((always_inline))
-int baz(int a, int b) {
+inline int baz(int a, int b) {
return a + b;
}
__attribute__((always_inline))
-int foo(int a, int b) {
+inline int foo(int a, int b) {
int c = a*2 + b;
c = baz(b, c);
return c;
}
__attribute__((always_inline))
-int bar(int a, int b) {
+inline int bar(int a, int b) {
int c = a + b;
c = foo(c, a*b);
return c;