Details Ticket 5002


Comment | Reply | Take | Open


Serial Number 5002
Subject lib/gis/color_str.c does not compile
Area grass6
Queue grass
Requestors harri.kiiskinen@utu.fi
Owner none
Status resolved
Last User Contact Tue Aug 15 05:07:17 2006 (2 yr ago)
Current Priority 70
Final Priority 70
Due No date assigned
Last Action Tue Aug 15 14:58:25 2006 (2 yr ago)
Created Mon Aug 14 21:12:47 2006 (2 yr ago)

Transaction History Ticket 5002


Mon, Aug 14 2006 21:12:47    Request created by guest  
Subject: lib/gis/color_str.c does not compile

Platform: Solaris2.x/Sparc
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: cvs checkout 20060814

When compiling with Sun C 5.5 2003/03/12 the following error is reported from
file color_str.c in lib/gis/:

"color_str.c", line 54: zero or negative subscript
"color_str.c", line 57: warning: syntax error:  empty initializer
"color_str.c", line 112: warning: statement not reached
cc: acomp failed for color_str.c

A workaround is to change row 46:
#define NUM_COLORS 1

and to uncomment line 56 to have one value in the table:
{"purple",  128,   0, 255}

It seems that a static construct without explicit initialization is not legal,
at least in this compilers opinion.

Harri K.
Tue, Aug 15 2006 05:07:17    Mail sent by glynn@gclements.plus.com  
Return-Path <glynn@gclements.plus.com>
Delivered-To grass-bugs@lists.intevation.de
From Glynn Clements <glynn@gclements.plus.com>
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
Message-ID <17633.14945.637209.284887@cerise.gclements.plus.com>
Date Tue, 15 Aug 2006 04:07:13 +0100
To Request Tracker <grass-bugs@intevation.de>
Cc grass-dev@grass.itc.it
Subject Re: [GRASS-dev] [bug #5002] (grass) lib/gis/color_str.c does not compile
In-Reply-To <20060814191247.9BF3E1006D6@lists.intevation.de>
References <20060814191247.9BF3E1006D6@lists.intevation.de>
X-Mailer VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
X-Virus-Scanned by amavisd-new at intevation.de
X-Spam-Status No, hits=-3.922 tagged_above=-999 required=3 tests=[AWL=1.078, BAYES_00=-5]
X-Spam-Level
Request Tracker wrote:

> this bug's URL: http://intevation.de/rt/webrt?serial_num=5002
> -------------------------------------------------------------------------
> 
> Subject: lib/gis/color_str.c does not compile
> 
> Platform: Solaris2.x/Sparc
> grass obtained from: CVS
> grass binary for platform: Compiled from Sources
> GRASS Version: cvs checkout 20060814
> 
> When compiling with Sun C 5.5 2003/03/12 the following error is reported from
file color_str.c in lib/gis/:
> 
> "color_str.c", line 54: zero or negative subscript
> "color_str.c", line 57: warning: syntax error:  empty initializer
> "color_str.c", line 112: warning: statement not reached
> cc: acomp failed for color_str.c
> 
> A workaround is to change row 46:
> #define NUM_COLORS 1
> 
> and to uncomment line 56 to have one value in the table:
> {"purple",  128,   0, 255}
> 
> It seems that a static construct without explicit initialization is not legal,
at least in this compilers opinion.

Zero-size arrays aren't legal C; they're a gcc extension.

It appears that the code in question was left in as "documentation" of
the previous behaviour.

Fixed in CVS.

-- 
Glynn Clements <glynn@gclements.plus.com>


Tue, Aug 15 2006 14:58:25    Status changed to resolved by mneteler  
Comment | Reply | Take | Open

You are currently authenticated as guest.
[Show Configuration] [Login as another user]

Users Guide - Mail Commands - Homepage of RequestTracker 1.0.7 - list any request