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

SourceForge.net noreply at sourceforge.net
Fri Mar 26 16:50:25 CET 2010


Bugs item #2977105, was opened at 2010-03-26 18:50
Message generated for change (Tracker Item Submitted) made by flatworm
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: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Konstantin Khomoutov (flatworm)
Assigned to: Nobody/Anonymous (nobody)
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.


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

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