<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 22, 2016 at 10:15 AM, Jonathan Gray <span dir="ltr"><<a href="mailto:jsg@jsg.id.au" target="_blank">jsg@jsg.id.au</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Apr 22, 2016 at 05:31:29PM +0100, Emil Velikov wrote:<br>
> On 22 April 2016 at 16:08, Jonathan Gray <<a href="mailto:jsg@jsg.id.au">jsg@jsg.id.au</a>> wrote:<br>
> > It is worth noting that the isl code extensively requires designated<br>
> > initialisers on anonymous structs. It isn't clear to me when gcc introduced<br>
> > support for this but it isn't in 4.2.<br>
> ><br>
> I think it should work for GCC 4.2 with -fms-extensions. We used to<br>
> set -std=gnu99 for pre 4.6 which effectively enables it the extension.<br>
> Can you double-check ?<br>
<br>
</span>The part that sets gnu99 for < gcc 4.6 is still there, using -fms-extensions<br>
does not help for these.<br>
<br>
libtool: compile: gcc -DPACKAGE_NAME=\"Mesa\" -DPACKAGE_TARNAME=\"mesa\" -DPACKAGE_VERSION=\"11.3.0-devel\" "-DPACKAGE_STRING=\"Mesa 11.3.0-devel\"" "-DPACKAGE_BUGREPORT=\"<a href="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa\</a>"" -DPACKAGE_URL=\"\" -DPACKAGE=\"mesa\" -DVERSION=\"11.3.0-devel\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DYYTEXT_POINTER=1 -DHAVE___BUILTIN_CLZ=1 -DHAVE___BUILTIN_CLZLL=1 -DHAVE___BUILTIN_CTZ=1 -DHAVE___BUILTIN_EXPECT=1 -DHAVE___BUILTIN_FFS=1 -DHAVE___BUILTIN_FFSLL=1 -DHAVE___BUILTIN_POPCOUNT=1 -DHAVE___BUILTIN_POPCOUNTLL=1 -DHAVE_FUNC_ATTRIBUTE_CONST=1 -DHAVE_FUNC_ATTRIBUTE_FLATTEN=1 -DHAVE_FUNC_ATTRIBUTE_FORMAT=1 -DHAVE_FUNC_ATTRIBUTE_MALLOC=1 -DHAVE_FUNC_ATTRIBUTE_PACKED=1 -DHAVE_FUNC_ATTRIBUTE_PURE=1 -DHAVE_FUNC_ATTRIBUTE_UNUSED=1 -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT=1 -DHAVE_DLADDR=1 -DHAVE_CLOCK_GETTIME=1 -DHAVE_PTHREAD_PRIO_INHERIT=1 -DHAVE_PTHREAD=1 -DHAVE_SHA1_IN_LIBC=1 -DHAVE_VALGRIND=1 -I. -I/usr/X11R6/include -I/usr/X11R6/include/libdrm -I/usr/local/include/valgrind -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DDEBUG -DTEXTURE_FLOAT_ENABLED -DUSE_X86_64_ASM -DHAVE_SYS_SYSCTL_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_DLOPEN -DHAVE_POSIX_MEMALIGN -DHAVE_LIBDRM -DHAVE_SHA1 -DGLX_USE_DRM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DHAVE_ALIAS -DHAVE_MINCORE -I../../../include -I../../../src -I../../../src/intel -I../../../src/mapi -I../../../src/mesa -I../../../src/mesa/drivers/dri/common -I../../../src/mesa/drivers/dri/i965 -I../../../src/gallium/auxiliary -I../../../src/gallium/include -I../../../src -I../../../src/intel -g -O2 -Wall -std=gnu99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-builtin-memcmp -Wno-override-init -DGEN_VERSIONx10=70 -g -O2 -Wall -std=gnu99 -Werror=implicit-function-declaration -Werror=missing-prototypes -fno-strict-aliasing -fno-math-errno -fno-trapping-math -fno-builtin-memcmp -MT libisl_gen7_la-isl_gen7.lo -MD -MP -MF .deps/libisl_gen7_la-isl_gen7.Tpo -c isl_gen7.c -fPIC -DPIC -o .libs/libisl_gen7_la-isl_gen7.o<br>
In file included from isl_gen7.h:26,<br>
from isl_gen7.c:24:<br>
isl_priv.h: In function 'isl_extent3d_sa_to_el':<br>
isl_priv.h:119: error: unknown field 'w' specified in initializer<br>
isl_priv.h:119: warning: missing braces around initializer<br>
isl_priv.h:119: warning: (near initialization for '(anonymous).<anonymous>')<br>
isl_priv.h:120: error: unknown field 'h' specified in initializer<br>
isl_priv.h:121: error: unknown field 'd' specified in initializer<br>
isl_priv.h: In function 'isl_extent3d_el_to_sa':<br>
isl_priv.h:131: error: unknown field 'w' specified in initializer<br>
isl_priv.h:131: warning: missing braces around initializer<br>
isl_priv.h:131: warning: (near initialization for '(anonymous).<anonymous>')<br>
isl_priv.h:132: error: unknown field 'h' specified in initializer<br>
isl_priv.h:133: error: unknown field 'd' specified in initializer<br>
isl_gen7.c: In function 'gen7_choose_image_alignment_el':<br>
isl_gen7.c:391: error: unknown field 'w' specified in initializer<br>
isl_gen7.c:391: warning: missing braces around initializer<br>
isl_gen7.c:391: warning: (near initialization for '(anonymous).<anonymous>')<br>
isl_gen7.c:392: error: unknown field 'h' specified in initializer<br>
isl_gen7.c:393: error: unknown field 'd' specified in initializer<br>
*** Error 1 in src/intel/isl (Makefile:744 'libisl_gen7_la-isl_gen7.lo')<br></blockquote><div><br></div><div>At least for the errors you're seeing there, I see two options: 1) Use the isl_extentNd constructor functions in isl.h. 2) Stop making isl_extentNd have anonymous unions. I'm not sure how much the anonymous unions are really doing for us but I'd like chad to chip in before we throw them out.<br><br></div><div>Here's another question: I know BSD doesn't ship gcc newer than 4.2 for license issues, but do you have a recent version of clang available?<br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
><br>
> > Would you accept patches to remove them?<br>
> While I cannot comment if they're OK with the idea, there might be<br>
> some confusion on the topic.<br>
> There is anonymous and named. I believe developers were against the<br>
> latter. Examples form [1]<br>
><br>
> struct bar { int i; }; // (1) unnamed, but tagged, ie *not* anonymous<br>
> struct { int j; }; // (2) unnamed, but anonymous<br>
> struct { int k; } baz; // (3) named, but not tagged<br>
><br>
> Fwiw it would be great to use the more portable solution. Would C11<br>
> buy us anything ?<br>
><br>
><br>
> Thanks<br>
> Emil<br>
><br>
> [1] <a href="http://stackoverflow.com/questions/5063548/initialization-of-anonymous-structures-or-unions-in-c1x" rel="noreferrer" target="_blank">http://stackoverflow.com/questions/5063548/initialization-of-anonymous-structures-or-unions-in-c1x</a><br>
</div></div></blockquote></div><br></div></div>