Idea for Google Summer Code : C Compiler for EFI Byte Code implement in gcc

b95705030@ntu.edu.tw b95705030@ntu.edu.tw
Thu Apr 1 18:10:00 GMT 2010


Hello Tristan

> I think the main issue is that EFI C dialect is not ANSI-C  
> compliant: the size of pointer is determined
> at the run-time and therefore the layout of the structure is not  
> static.  Gcc doesn't support this model.

I have read the sizeof and VLA in C99
I found a example:
EXAMPLE 3 In this example, the size of a variable-length array is  
computed and returned from a function:
#include <stddef.h>
size_t fsize3(int n)
{
   char b[n+3]; // variable length array
   return sizeof b; // execution time sizeof
}
int main()
{
   size_t size;
   size = fsize3(10); // fsize3 returns 13
   return 0;
}
And I found some information with gcc about VLA
(http://gcc.gnu.org/c99status.html)
Does it means that gcc support layout of structure is not static??

thanks

yi-hong





More information about the Gcc mailing list