bug-gv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gv] [bug #23972] gv-3.6.5 won't build on solaris 9 with sun studio


From: David Diffenbaugh
Subject: [bug-gv] [bug #23972] gv-3.6.5 won't build on solaris 9 with sun studio 11 compiler
Date: Thu, 31 Jul 2008 21:43:07 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1

URL:
  <http://savannah.gnu.org/bugs/?23972>

                 Summary: gv-3.6.5 won't build on solaris 9 with sun studio
11 compiler
                 Project: GNU gv
            Submitted by: davediff
            Submitted on: Thursday 07/31/2008 at 21:43
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: None

    _______________________________________________________

Details:

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



    _______________________________________________________

File Attachments:


-------------------------------------------------------
Date: Thursday 07/31/2008 at 21:43  Name: gv-zero-length.patch  Size: 411B  
By: davediff

<http://savannah.gnu.org/bugs/download.php?file_id=16218>

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?23972>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]