[LLVMbugs] [Bug 5841] New: clang cannot compile initialized struct containing union

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Dec 20 12:30:19 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5841

           Summary: clang cannot compile initialized struct containing union
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: rene at freebsd.org
                CC: llvmbugs at cs.uiuc.edu


while compiling gettext 0.17 ( http://www.gnu.org/software/gettext/ ) with
recent clang (e.g. r91792), from the build:

libtool: compile:  clang -c -DLOCALEDIR=\"/usr/local/share/locale\"
-DLOCALE_ALIAS_PATH=\"/usr/local/share/locale\" -DLIBDIR=\"/usr/local/libdata\"
-DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1
-DIN_LIBRARY -DINSTALLDIR=\"/usr/local/lib\" -DNO_XMALLOC
-Dset_relocation_prefix=libintl_set_relocation_prefix
-Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -I. -I.
-I.. -I/usr/local/include -O2 -pipe -fno-strict-aliasing -fvisibility=hidden
./plural-exp.c  -fPIC -DPIC -o .libs/plural-exp.o
Stack dump:
0.      Program arguments: /usr/bin/clang -cc1 -triple i386-unknown-freebsd8.0
-S -disable-free -main-file-name plural-exp.c -pic-level 2 -mdisable-fp-elim
-target-cpu pentium4 -resource-dir /usr/lib/clang/1.1
-DLOCALEDIR="/usr/local/share/locale"
-DLOCALE_ALIAS_PATH="/usr/local/share/locale" -DLIBDIR="/usr/local/libdata"
-DBUILDING_LIBINTL -DBUILDING_DLL -DIN_LIBINTL -DENABLE_RELOCATABLE=1
-DIN_LIBRARY -DINSTALLDIR="/usr/local/lib" -DNO_XMALLOC
-Dset_relocation_prefix=libintl_set_relocation_prefix
-Drelocate=libintl_relocate -DDEPENDS_ON_LIBICONV=1 -DHAVE_CONFIG_H -DPIC -I.
-I. -I.. -I/usr/local/include -O2 -fmessage-length 0 -fvisibility hidden
-fgnu-runtime -fdiagnostics-show-option -o /tmp/cc-KCH8M7.s -x c ./plural-exp.c 
1.      ./plural-exp.c:61:2: current parser token ';'
clang: error: compiler command failed due to signal 11 (use -v to see
invocation)

Offending code:

struct expression GERMANIC_PLURAL =
{
  .nargs = 2,
  .operation = not_equal,
  .val =
  {
    .args =
    { 
      [0] = (struct expression *) &plvar,
      [1] = (struct expression *) &plone
    }
  }
}; /* line 61 */

with expression being defined as:

/* This is the representation of the expressions to determine the
   plural form.  */
struct expression
{
  int nargs;                    /* Number of arguments.  */
  enum expression_operator operation;
  union
  {
    unsigned long int num;      /* Number value for `num'.  */
    struct expression *args[3]; /* Up to three arguments.  */
  } val;
};


An older revision (e.g. r88856) compiled the file.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list