I'm looking at the code file found here https://sourceware.org/svn/gcc/tags/var-tracking-assignments-merge-150905-before/gcc/testsuite/gcc.target/i386/loop-1.c (I found it under a folder called gcc-torture. Turns out it doesn't torture only just gcc)
My question is this: how many legal data declarations does this snippet have?
f1 (a)
long a;
{
int i;
for (i = 0; i < 10; i++)
{
if (--a == -1)
return i;
}
return -1;
}
I believe it only has one (int i;
), but I'm unsure about that strangely placed long a;
. Does that count as a data declaration? How is it even legal to stuff an apparent data declaration ending in a line terminator inside a function declaration?
It's K&R syntax for function definition. It's pretty much obsolete now, but can still be compiled. These are identical: