diff options
| author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2014-08-04 19:33:42 +0100 |
|---|---|---|
| committer | Christopher Li <sparse@chrisli.org> | 2014-10-10 22:43:37 +0800 |
| commit | 126a785f0e010d6f1fe07cf0989e4969836ec804 (patch) | |
| tree | e19efe47d826a5bde85d03089efe05fe81b394ad | |
| parent | b6c1d2fe571a8c0b023d17f0557774c8af93fe85 (diff) | |
| download | sparse-dev-126a785f0e010d6f1fe07cf0989e4969836ec804.tar.gz | |
sparse: add 'gnu_inline' to the ignored attributes
Add some more ignored attributes which are used in glibc header files,
along with a simple test case which includes all three inline attributes
(__gnu_inline__, __always_inline__ and __noinline__).
Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Christopher Li <sparse@chrisli.org>
| -rw-r--r-- | parse.c | 2 | ||||
| -rw-r--r-- | validation/attr-inline.c | 21 |
2 files changed, 23 insertions, 0 deletions
@@ -536,6 +536,8 @@ const char *ignored_attributes[] = { "__format__", "format_arg", "__format_arg__", + "gnu_inline", + "__gnu_inline__", "hot", "__hot__", "leaf", diff --git a/validation/attr-inline.c b/validation/attr-inline.c new file mode 100644 index 00000000..1b88ddb9 --- /dev/null +++ b/validation/attr-inline.c @@ -0,0 +1,21 @@ + +static inline __attribute__((__always_inline__)) int gt(int lhs, int rhs) +{ + return lhs > rhs; +} + +extern inline __attribute__((__gnu_inline__)) int ge(int lhs, int rhs) +{ + return lhs >= rhs; +} + +static __attribute__((__warning__("That's junk!"))) __attribute__((__unused__)) +__attribute__((__noinline__)) +void junk(void) +{ + __asm__(""); +} + +/* + * check-name: inline attributes + */ |
