bugGNU gv - Bugs: bug #23972, gv-3.6.5 won't build on solaris 9...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #23972: gv-3.6.5 won't build on solaris 9 with sun studio 11 compiler

Submitter:  David Diffenbaugh <davediff>
Submitted:  Thu 31 Jul 2008 09:43:05 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  msteinbo
Open/Closed:  Closed Release:  3.6.5

Fri 01 Aug 2008 06:35:28 AM UTC, comment #1: 

Thank cou for the bug report. The problem is: If I apply your patch, then

./configure CFLAGS="-Wall --pedantic --std=c99" ; make clean ; make

will result in

In file included from resource.c:54:
main_resources.h:245: Warnung: ISO-C verbietet leere Initialisierungsklammern
main_resources.h:244: Fehler: Feldgröße von »options« ist null oder negativ
make[2]: * [resource.o] Fehler 1

on my linux system so it may break c89 and c99 compilers. Your warnimngs tell you that after the patch your code is not c99 compliant.

I need some investigation to decide what to do. Comments are welcome.

Markus Steinborn <msteinbo>
Group administrator
Thu 31 Jul 2008 09:43:05 PM UTC, original submission:  

I'm getting this compilation error:

cc -DHAVE_CONFIG_H -I.  -DNON_BLOCKING_IO -DGV_CODE -DGV_CODE -DGV_LIBDIR=\"/usr/local/lib/gv\" -I../lib -I../lib -g -I/usr/local/include -I/usr/openwin/include -DUSE_SETENV_CODE -g -c resource.c
"main_resources.h", line 244: zero or negative subscript
"main_resources.h", line 245: warning: syntax error:  empty initializer
cc: acomp failed for resource.c

The relevant line of code is in gv-3.6.5/src/main_resources.h:

static XrmOptionDescRec options[0] = {
};

I believe declaring arrays with zero length is a gcc extension and causes this to break with Sun Studio 11 which is c99 compliant.

A link to a brief discussion of this:
http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/gcc/Zero-Length.html

I attached a patch which leaves the zero out that compiles with only the following warnings:

"main_resources.h", line 245: warning: syntax error:  empty initializer
"main_resources.h", line 245: warning: null dimension: options
"resource.c", line 342: warning: null dimension: sizeof()

I'm not sure if these are anything to worry about. I know that sizeof(options) will return 0 which seems sensible. After building this way gv appears to work fine while testing.

If this workaround looks correct, would it be possible to have it included in the next release so that gv can be compiled on Solaris 9 without these issues.

Thanks

David Diffenbaugh <davediff>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #16218:  gv-zero-length.patch added by davediff (411B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by msteinbo (Posted a comment)
  • -email is unavailable- added by davediff (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-09 msteinbo StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2008-08-01 msteinbo StatusIn Progress Ready For Test
    2008-08-01 msteinbo StatusNone In Progress
        Assigned toNone msteinbo
        ReleaseNone 3.6.5
    2008-07-31 davediff Attached File- Added gv-zero-length.patch, #16218

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code