API : objects.h not compliant with C++ ?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jfr
Posts: 2
Joined: Sun Aug 12, 2012 10:52 am

API : objects.h not compliant with C++ ?

Post by jfr »

hey all,

I'm trying to build my own broker using C++ language ( g++-4.7.real (Debian 4.7.1-2) 4.7.1, nagios 3.4.1 ).

Something goes wrong when g++ compiles the commandsmember structure in objects.h :

/* COMMANDSMEMBER structure */
typedef struct commandsmember_struct {
char *command;
#ifdef NSCORE
command *command_ptr;
#endif
struct commandsmember_struct *next;
} commandsmember;

../include/objects.h:180:2: error: ‘command’ does not name a type. I think it is C++'s rule C++11 3.3.10/1:

"A name can be hidden by an explicit declaration of that same name in a nested declarative region or derived class."

So I came with that patch which seems to be the best way to get both gcc and g++ happy.

--- objects.h.org 2012-08-12 17:46:35.000000000 +0200
+++ objects.h 2012-08-12 18:00:24.000000000 +0200
@@ -177,7 +177,7 @@
typedef struct commandsmember_struct {
char *command;
#ifdef NSCORE
- command *command_ptr;
+ struct command_ptr *command_ptr;
#endif
struct commandsmember_struct *next;
} commandsmember;

jfr
agriffin
Posts: 876
Joined: Mon May 09, 2011 9:36 am

Re: API : objects.h not compliant with C++ ?

Post by agriffin »

Unfortunately, the main Nagios Core developers do not frequent this forum. You should post this patch to the nagios-devel mailing list and/or the bug tracker.
jfr
Posts: 2
Joined: Sun Aug 12, 2012 10:52 am

Re: API : objects.h not compliant with C++ ?

Post by jfr »

Moved to nagios-devel list, thx agriffin.

JFR
Locked