Ticket #1749 (closed defect: fixed)

Opened 7 years ago

Last modified 6 years ago

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

compiler-bug.patch (3.2 KB) - added by sfionov 7 years ago.

Change History

Changed 7 years ago by sfionov

comment:1 Changed 7 years ago by slavazanko

  • Status changed from new to accepted
  • Owner set to slavazanko
  • Milestone set to 4.7

comment:2 Changed 6 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:3 Changed 6 years ago by andrew_b

  • Votes for changeset set to andrew_b

comment:4 Changed 6 years ago by iNode

  • Votes for changeset changed from andrew_b to andrew_b iNode
  • severity changed from on review to approved

comment:5 Changed 6 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b iNode to commited-master
  • Resolution set to fixed
  • severity changed from approved to merged

comment:6 Changed 6 years ago by slavazanko

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.