[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-cflow] reduced test case for attribute parsing problem
From: |
Britton Kerin |
Subject: |
[bug-cflow] reduced test case for attribute parsing problem |
Date: |
Wed, 6 Apr 2016 16:09:00 -0800 |
Below is a simple-as-possible test case which shows one of the
attribute parsing bugs I reported the other day. I'll try to make a
test case for the other later.
If you don't want to work on these right now I could perhaps fix them,
though I'm sure you could do it faster. Thanks
$ cat test.c
#include <stddef.h>
__attribute__((__malloc__))
__attribute__((__alloc_size__(1)))
void* test_malloc (size_t bytes);
__attribute__((__malloc__))
__attribute__((__alloc_size__(1)))
void* test_malloc0 (size_t bytes);
// Dummy implementations
void *test_malloc (size_t bytes) { bytes = bytes; return NULL; }
void *test_malloc0 (size_t bytes) { bytes = bytes; return NULL; }
int
main (void)
{
test_malloc (42);
test_malloc0 (42);
return 0;
}
$ gcc -Wall -Wextra -Werror test.c
$ cflow --symbol __attribute__:wrapper test.c
cflow:test.c:9: __alloc_size__/0 redefined
cflow:test.c:5: this is the place of previous definition
main() <int main (void) at test.c:17>:
test_malloc() <void *test_malloc (size_t bytes) at test.c:13>:
test_malloc0() <void *test_malloc0 (size_t bytes) at test.c:14>:
$
- [bug-cflow] reduced test case for attribute parsing problem,
Britton Kerin <=