Closed
Description
Consider the following code:
#define ulong unsigned long
ulong * TOP;
ulong channelColumns;
void
DescribeChannel(void)
{
ulong col;
TOP = (ulong *)malloc((channelColumns+1) * sizeof(ulong));
TOP[col] = 0;
}
When you run with alltypes
:
./cconv-standalone -alltypes <foo.c>
, you get the following:
#define ulong unsigned long
_Array_ptr<unsigned long> TOP = ((void * TOP)0);
ulong channelColumns;
void
DescribeChannel(void)
{
ulong col;
TOP = (_Array_ptr<unsigned long> )malloc((channelColumns+1) * sizeof(ulong));
TOP[col] = 0;
}
See the invalid cast:
_Array_ptr<unsigned long> TOP = ((void * TOP)0);
This has to be:
_Array_ptr<unsigned long> TOP = ((void *)0);
Some issue with the latest DeclRewriter refactoring.