[Nagiosplug-devel] [ nagiosplug-Bugs-2977105 ] check_ide_smart.c won't build with gcc 2.96

SourceForge.net noreply at sourceforge.net
Sat Mar 27 05:18:59 CET 2010


Bugs item #2977105, was opened at 2010-03-26 11:50
Message generated for change (Comment added) made by dermoth
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2977105&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Compilation
>Group: release-1.4.15
>Status: Closed
>Resolution: Fixed
Priority: 5
Private: No
Submitted By: Konstantin Khomoutov (flatworm)
>Assigned to: Thomas Guyot-Sionnest (dermoth)
Summary: check_ide_smart.c won't build with gcc 2.96

Initial Comment:
check_ide_smart.c fails to build with gcc 2.96 raising this error:

check_ide_smart.c: In function `main':
check_ide_smart.c:164: parse error before `static'
check_ide_smart.c:182: `longopts' undeclared (first use in this function)
check_ide_smart.c:182: (Each undeclared identifier is reported only once
check_ide_smart.c:182: for each function it appears in.)

(This particular build was configured without --enable-extra-opts, but I beleive this won't change anything, see below.)

As it seems, the failing piece of code assumes the compiler supports C99, that is, allows to mix initializations with declarations, which gcc 2.96 doesn't.
The attached patch trivially fixes this problem by moving the code which performs initialization after the declaration of a static struct data.


----------------------------------------------------------------------

>Comment By: Thomas Guyot-Sionnest (dermoth)
Date: 2010-03-27 00:18

Message:
Nice catch; fixed

Thanks!

----------------------------------------------------------------------

Comment By: Konstantin Khomoutov (flatworm)
Date: 2010-03-26 11:51

Message:
Updated category and group to sensible values.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=2977105&group_id=29880




More information about the Devel mailing list