------- Comment #4 from dominique dot pelle at gmail dot com 2008-11-15 21:21 ------- I tried the suggestion of Richard Guenther in his previous comments. That is changing vim's code as follows:
cvs diff: CVS password file /home/pel/.cvspass does not exist - creating a new file Index: eval.c =================================================================== RCS file: /cvsroot/vim/vim7/src/eval.c,v retrieving revision 1.270 diff -c -r1.270 eval.c *** eval.c 12 Nov 2008 14:29:28 -0000 1.270 --- eval.c 15 Nov 2008 20:59:18 -0000 *************** *** 224,233 **** ufunc_T *func; /* function being called */ int linenr; /* next line to be executed */ int returned; /* ":return" used */ ! struct /* fixed variables for arguments */ { dictitem_T var; /* variable (without room for name) */ ! char_u room[VAR_SHORT_LEN]; /* room for the name */ } fixvar[FIXVAR_CNT]; dict_T l_vars; /* l: local function variables */ dictitem_T l_vars_var; /* variable for l: scope */ --- 224,233 ---- ufunc_T *func; /* function being called */ int linenr; /* next line to be executed */ int returned; /* ":return" used */ ! union /* fixed variables for arguments */ { dictitem_T var; /* variable (without room for name) */ ! char_u room[sizeof(dictitem_T) + VAR_SHORT_LEN];/* room for the name */ } fixvar[FIXVAR_CNT]; dict_T l_vars; /* l: local function variables */ dictitem_T l_vars_var; /* variable for l: scope */ But it makes no difference: I still get the compilation warnings and the crash at run time. Should we keep this bug as "RESOLVED" or reopen it? It's not clear to me that there is no bug in gcc here. When you write... "Crossing objects from di_key to room is not allowed by the C standard" ... where is the source of this? You might be completely right, but I'm not not sure, and I'm curious. Note that vim's source is not using the C99 trailing array (but the old style C90. Isn't valid C90 code? and if so, shouldn't gcc produce the right code with -O3? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38136