aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Makefile
diff options
authorRamsay Jones <ramsay@ramsayjones.plus.com>2019-02-06 01:14:41 +0000
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2019-02-07 22:49:32 +0100
commitec2c615d630bbec82c5f3d2bcbd82273ffadf8f4 (patch)
treec4a306c370378443ea52a717103fbb29ba59ba6c /Makefile
parent4ba10f29f54214cfa39c5fc324ca45df55c4fecd (diff)
downloadsparse-dev-ec2c615d630bbec82c5f3d2bcbd82273ffadf8f4.tar.gz
redecl: add test for attribute placement in function declarators
Add a new test file which demonstrates some problems which can be seen on the git codebase. gcc does not complain about this file: $ gcc -Wall -c validation/function-redecl2.c $ ... but sparse does: $ sparse validation/function-redecl2.c validation/function-redecl2.c:6:5: error: symbol 'func0' redeclared with different type (originally declared at validation/function-redecl2.c:3) - different modifiers validation/function-redecl2.c:13:6: error: symbol 'func1' redeclared with different type (originally declared at validation/function-redecl2.c:11) - different modifiers validation/function-redecl2.c:21:6: error: symbol 'func2' redeclared with different type (originally declared at validation/function-redecl2.c:18) - different modifiers $ Note that func0 and func2 are essentially the same example, apart from the attribute used, to demonstrate that the issue isn't caused by the 'pure' attribute. Also, examples like func1 have occurred several times in git and, although they can be worked around (eg. See [1]), it would be preferable if this were not necessary. [1] (git) commit 3d7dd2d3b6 ("usage: add NORETURN to BUG() function definitions", 2017-05-21). Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'Makefile')
0 files changed, 0 insertions, 0 deletions