Xymon Mailing List Archive search

4.2-Alpha Make error

3 messages in this thread

list Chris Morris · Wed, 5 Apr 2006 11:06:25 +0100 ·
Hi Henrik,

Running on RedHat 7.1 with 2.4.3-6 Kernel, get the following error :-

gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DLINUX -I.
-I/usr/local/hobbit-4.2-alfa-20060404/include -I/usr/include/pcre -I.
-I../include    -c -o strfunc.o strfunc.c
strfunc.c: In function `grabstrbuffer':
strfunc.c:76: parse error before `char'
strfunc.c:79: `result' undeclared (first use in this function)
strfunc.c:79: (Each undeclared identifier is reported only once
strfunc.c:79: for each function it appears in.)
strfunc.c:80: warning: control reaches end of non-void function
gmake[1]: *** [strfunc.o] Error 1
gmake[1]: Leaving directory `/usr/local/hobbit-4.2-alfa-20060404/lib'
gmake: *** [lib-build] Error 2

Regards,

Chris


****************************************************************************
The information contained in this email is intended only for the use of the intended recipient at the email address to which it has been addressed. If the reader of this message is not an intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination or copying of the message or associated attachments is strictly prohibited.

If you have received this email in error, please contact the sender by return email or call 01793 877777 and ask for the sender and then delete it immediately from your system.Please note that neither RWE npower nor the sender accepts any responsibility for viruses and it is your responsibility to scan attachments (if any).
*****************************************************************************
list Shinjiro Naoi · Wed, 05 Apr 2006 21:25:53 +0900 (JST) ·
However, it is not only ANSI style.

--- hobbit-4.2-alfa-20060404/lib/strfunc.c      2006-04-01 06:39:10.000000000 +0900
+++ hobbit-4.2-alfa-20060404-new/lib/strfunc.c  2006-04-05 20:18:39.840342000 +0900
@@ -71,9 +71,9 @@

 char *grabstrbuffer(strbuffer_t *buf)
 {
+       char *result = buf->s;
        if (buf == NULL) return NULL;

-       char *result = buf->s;
        xfree(buf);

        return result;
quoted from Chris Morris


From: "Morris, Chris (Shared Services)" <user-7c3d847d296d@xymon.invalid>
Subject: [hobbit] 4.2-Alpha Make error
Date: Wed, 5 Apr 2006 11:06:25 +0100
Hi Henrik,

Running on RedHat 7.1 with 2.4.3-6 Kernel, get the following error :-

gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DLINUX -I.
-I/usr/local/hobbit-4.2-alfa-20060404/include -I/usr/include/pcre -I.
-I../include    -c -o strfunc.o strfunc.c
strfunc.c: In function `grabstrbuffer':
strfunc.c:76: parse error before `char'
strfunc.c:79: `result' undeclared (first use in this function)
strfunc.c:79: (Each undeclared identifier is reported only once
strfunc.c:79: for each function it appears in.)
strfunc.c:80: warning: control reaches end of non-void function
gmake[1]: *** [strfunc.o] Error 1
gmake[1]: Leaving directory `/usr/local/hobbit-4.2-alfa-20060404/lib'
gmake: *** [lib-build] Error 2

Regards,

Chris


****************************************************************************
The information contained in this email is intended only for the use of the intended recipient at the email address to which it has been addressed. If the reader of this message is not an intended recipient, you are hereby notified that you have received this document in error and that any review, dissemination or copying of the message or associated attachments is strictly prohibited.

If you have received this email in error, please contact the sender by return email or call 01793 877777 and ask for the sender and then delete it immediately from your system.Please note that neither RWE npower nor the sender accepts any responsibility for viruses and it is your responsibility to scan attachments (if any).
*****************************************************************************

list Henrik Størner · Wed, 5 Apr 2006 14:31:03 +0200 ·
quoted from Shinjiro Naoi
On Wed, Apr 05, 2006 at 11:06:25AM +0100, Morris, Chris (Shared Services) wrote:
Running on RedHat 7.1 with 2.4.3-6 Kernel, get the following error :-

gcc -g -O2 -Wall -Wno-unused -D_REENTRANT -DLINUX -I.
-I/usr/local/hobbit-4.2-alfa-20060404/include -I/usr/include/pcre -I.
-I../include    -c -o strfunc.o strfunc.c
strfunc.c: In function `grabstrbuffer':
strfunc.c:76: parse error before `char'
OK, this happens with some older compilers only, I think. This patch
should fix it.

Henrik

-------------- next part --------------
--- lib/strfunc.c	2006/03/31 20:55:52	1.5
+++ lib/strfunc.c	2006/04/05 12:29:05
@@ -11,7 +11,7 @@
 /*                                                                            */
 /*----------------------------------------------------------------------------*/
 
-static char rcsid[] = "$Id: strfunc.c,v 1.5 2006/03/31 20:55:52 henrik Exp $";
+static char rcsid[] = "$Id: strfunc.c,v 1.6 2006/04/05 12:28:57 henrik Exp $";
 
 #include "config.h"
 
@@ -71,9 +71,11 @@
 
 char *grabstrbuffer(strbuffer_t *buf)
 {
+	char *result;
• if (buf == NULL) return NULL;
 
-	char *result = buf->s;
+	result = buf->s;
 	xfree(buf);
 
 	return result;