Issue with objects.h

Andreas Ericsson ae at op5.se
Mon Sep 17 17:06:10 CEST 2012


On 09/17/2012 01:18 PM, Jean-François Rameau wrote:
> 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


How can this possibly make gcc happy? "struct command_ptr" is not
a type no matter if you use C or C++.

I'd be all for renaming "host" to "struct host" everywhere and
doing the same for all obects (but not before 5.0 :-/), but this
patch can't compile at all.

-- 
Andreas Ericsson                   andreas.ericsson at op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Nagios-devel mailing list
Nagios-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-devel


More information about the Developers mailing list