Nagios headers fails to compile in C++

Andreas Ericsson ae at op5.se
Thu Dec 16 11:25:47 CET 2010


On 12/15/2010 05:49 PM, Matthieu Kermagoret wrote:
> On Wed, Dec 15, 2010 at 5:24 PM, Glenn Herteg<gherteg at gwoslabs.com>  wrote:
>>   >  It can't go in before 3.3 at the earliest. Otherwise I think it's a
> 
> Do you have any ETA about the release date of the 3.3 series ?
> 

No. Ethan is still the only one who can push the release button. Otherwise
I'd have cut a release quite a while ago.

>>   >  pretty good idea to either stay away from C++ reserved words entirely
>>   >  or declare plain C as the only valid language for NEB modules.
>>
> 
> I definitely vote for no C++ keywords ;-) There is not much than C and
> they're not that obvious and/or widely used.
> 
>> I don't get it.  Since when are "command" and "contact" reserved words
>> in C++?
>>
> 
> They're not. They're types defined in Nagios headers.
> 

Oh. Can't C++ handle types as variable names? That's pretty weak tbh.
I'll make a note of it. In the future, the object types will be either
"struct <type>" or "<type>_object". We save no typing for either case,
and abbreviating "_object" to "_obj" seems a bit silly to me. We'll
probably go with "struct host". That will also make it possible to
name instances of the structs to the type they're referring to, such
that

 struct host *host;

works well. Does this also work nicely with C++, or do we have to play
prefix/suffix games?

>> I suspect a conflict not with the C++ language, but with something else
>> in the OP's compilation environment.
>>
>> While "command" ->  "cmd" is a common substitution in programs, I strongly
>> dislike the "contact" ->  "cntct" transformation.  It's far less readable.
>> Vowels are in the language for a reason.
>>
> 
> Vowels are certainly useful but the problem is that 'contact' is also
> a type. And as a matter of fact, the 'cntct' substitution is already
> used thorough the code.
> 

I dislike such abbreviations too, and I mean to get rid of them when
refactoring code that uses them, but that can't happen until we get
rid of the types named as objects without suffixes.

-- 
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.

------------------------------------------------------------------------------
Lotusphere 2011
Register now for Lotusphere 2011 and learn how
to connect the dots, take your collaborative environment
to the next level, and enter the era of Social Business.
http://p.sf.net/sfu/lotusphere-d2d




More information about the Developers mailing list