Actions
Bug #5314
openInvalid type encountered (hidden by variable name)
Start date:
10/07/2014
Due date:
% Done:
0%
Estimated time:
Detected in build:
2c42610
Platform:
Published in build:
Description
For the code
ax25_dev *ax25_dev;
...
if ((ax25_dev = ax25_dev_ax25dev(dev)) == NULL)
goto free;
C-Backend generates
ax25_dev *ax25_dev;
# 232 "net/ax25/ax25_in.o.c.prepared"
...
# 234 "net/ax25/ax25_in.o.c.prepared"
if (( ax25_dev = ax25_dev_ax25dev ( dev ) ) == ( ( ax25_dev *) 0 ))
goto free;
GCC error:
net/ax25/ax25_in.o.c.prepared: In function ‘ax25_rcv’: net/ax25/ax25_in.o.c.prepared:234:64: error: expected expression before ‘)’ token
CPAchecker fails with
Error: Parsing failed (Invalid type encountered in: ax25_dev in line 65224: ax25_dev (full line is if (( ax25_dev = ax25_dev_ax25dev ( dev ) ) == ( ( ax25_dev *) 0 )) goto free;)) (EclipseCParser.buildCFA, SEVERE)
32_7a, linux-3.17-rc1, net/ax25/ax25.ko
Updated by Evgeny Novikov about 10 years ago
- Status changed from New to Feedback
Please, fix description since source code doesn't look good and it isn't clear where the bug.
Updated by Vadim Mutilin about 10 years ago
- Status changed from Feedback to Open
Updated by Evgeny Novikov about 10 years ago
- Assignee set to Evgeny Novikov
Looks like braces around "( ax25_dev *) 0" are excessive.
Updated by Alexey Khoroshilov about 10 years ago
Evgeny Novikov wrote:
Looks like braces around "( ax25_dev *) 0" are excessive.
Braces do not play any role. The problem is ax25_dev is redefined as variable name in local namespace instead of typedef name in global namespace. If NULL would be printed as ((void*)0), problem should gone.
Updated by Evgeny Novikov almost 9 years ago
- Category set to C back-end
- Priority changed from Normal to High
Actions