Ticket #1749 (closed defect: fixed)
mc does not build with Sun Studio compiler
Reported by: | sfionov | Owned by: | slavazanko |
---|---|---|---|
Priority: | major | Milestone: | 4.7.0 |
Component: | mc-core | Version: | 4.7.0-pre3 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | Votes for changeset: | committed-master |
Description
Sun Studio C compiler has a bug parsing multi-level designated initializers when initializing an array of nested structures.
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6888373
Part of build log:
/bin/sh ../../libtool --tag=CC --mode=compile /opt/sunstudio12.1/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I/usr/X11/include -I../ -I../../src -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -DDATADIR=\""/usr/share/mc/"\" -DLOCALEDIR=\""/usr/share/locale"\" -g -c -o libmcviewer_la-dialogs.lo `test -f 'dialogs.c' || echo './'`dialogs.c /opt/sunstudio12.1/bin/cc -DHAVE_CONFIG_H -I. -I../.. -I/usr/X11/include -I../ -I../../src -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include "-DDATADIR=\"/usr/share/mc/\"" "-DLOCALEDIR=\"/usr/share/locale\"" -g -c dialogs.c -KPIC -DPIC -o .libs/libmcviewer_la-dialogs.o "dialogs.c", line 82: structure/union designator used on non-struct/union type "dialogs.c", line 82: structure/union designator used on non-struct/union type "dialogs.c", line 82: structure/union designator used on non-struct/union type "dialogs.c", line 82: structure/union designator used on non-struct/union type "dialogs.c", line 82: structure/union designator used on non-struct/union type "dialogs.c", line 82: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: structure/union designator used on non-struct/union type "dialogs.c", line 83: warning: enum type mismatch: op "="
The problem is with initializers in QuickWidget? macros from wtools.h.
The solution is to change look of initializers to be compiled even with buggy parser, or wait for next Sun Studio update.
Current Sun Studio users may use the attached patch. The patch does not affect behaviour of not buggy C99 compilers (e.g. GCC).
Attachments
Change History
comment:1 Changed 15 years ago by slavazanko
- Owner set to slavazanko
- Status changed from new to accepted
- Milestone set to 4.7
comment:2 Changed 15 years ago by slavazanko
- severity changed from no branch to on review
- Milestone changed from 4.7 to 4.7.0
Created branch 1749_sunstudio_compiler.
Initial changeset:ac89361e3980799d0efcc5c144398e731cad66d9
Review.
comment:4 Changed 15 years ago by iNode
- Votes for changeset changed from andrew_b to andrew_b iNode
- severity changed from on review to approved