This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Idea for Google Summer Code : C Compiler for EFI Byte Code implement in gcc
- From: b95705030 at ntu dot edu dot tw
- To: Tristan Gingold <gingold at adacore dot com>
- Cc: gcc at gnu dot org
- Date: Fri, 02 Apr 2010 02:02:48 +0800
- Subject: Re: Idea for Google Summer Code : C Compiler for EFI Byte Code implement in gcc
- References: <20100303125237.16796kozl451k845@wmail1.cc.ntu.edu.tw> <4B8E3BC8.9080306@redhat.com> <0DC9E7E9-1A64-420C-A0E4-9DD91F55AA28@adacore.com>
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