Opened 2 weeks ago
Last modified 5 days ago
#14967 accepted defect
internalAstError with function pointer in if
| Reported by: | chrchr | Owned by: | chrchr |
|---|---|---|---|
| Priority: | Normal | Milestone: | 2.22 |
| Component: | Other | Version: | |
| Keywords: | internalAstError c | Cc: |
Description
libvips-8.18.4/libvips/iofuncs/threadpool.c:
void f(int (*fp)()) { if (fp && fp()) {} }
test.cpp:2:12: error: Syntax Error: AST broken, binary operator is missing operand(s). [internalAstError]
if (fp && fp()) {}
^
Requires --language=c.
Change History (2)
comment:1 by , 2 weeks ago
| Milestone: | → 2.22 |
|---|---|
| Owner: | changed from to |
| Status: | new → accepted |
comment:2 by , 5 days ago
Variation:
//void *p, *q;
void f(int (*cmp)(void*, void*)) {
if (cmp) {
if (p && q && cmp(p, q) >= 0) {}
}
}
Note:
See TracTickets
for help on using tickets.
Started with https://github.com/cppcheck-opensource/cppcheck/commit/5aa31d0da84926c8abf213942498c53cba2445c1