Posted Oct 26, 2010 11:50 UTC (Tue) by jwakely (subscriber, #60262)
[Link]
does the kernel compile as C99? or does it compile as C90 with GNU extensions such as VLAs?
I wouldn't be surprised if Clang only supports VLAs in C99 mode
Clang builds a working 2.6.36 Kernel
Posted Oct 26, 2010 11:55 UTC (Tue) by jwakely (subscriber, #60262)
[Link]
http://clang.llvm.org/compatibility.html#vla
that's in the context of C++, apparently Clang defaults to C99 for C (which is correct as that's the current standard) so I wonder why VLAs are described as unsupported - maybe a mistake
Clang builds a working 2.6.36 Kernel
Posted Oct 26, 2010 23:07 UTC (Tue) by wash (guest, #70825)
[Link]
Very much so a mistake, my apologizes. I meant to refer to the GNU extension that allows variable length arrays in structures.
Clang builds a working 2.6.36 Kernel
Posted Oct 26, 2010 23:45 UTC (Tue) by Trelane (subscriber, #56877)
[Link]
by "VLAs in structs" are you referring to flexible array members?
Clang builds a working 2.6.36 Kernel
Posted Oct 30, 2010 12:32 UTC (Sat) by viro (subscriber, #7872)
[Link]
Much worse than that. It allows (and kernel does *not* use, unless something has drastically and cretinously changed) things like that:
extern void g(int *);
void f(int m, int n)
{
struct foo {
int a[n];
int b[n][m + 69];
} x;
g(&x.b[1][1]);
}
Yes, gcc is that sick.
Clang builds a working 2.6.36 Kernel
Posted Oct 27, 2010 9:36 UTC (Wed) by jwakely (subscriber, #60262)
[Link]