Page 1 of 1

[Nagios-devel] Problems... and temporary solutions compiling nagios in Tru64V5

Posted: Tue Oct 08, 2002 4:33 pm
by Guest
Hi, after a succeful compilation of nagios in Linux RedHat 7.x,
I tried with Tru 64 Unix V5.1. The compiler seems more
rigurous (and correct):

BTW, I'm using nagios-1.0b6 source (downloaded last week, not CVS)


1)../common/downtime.c:
cc: Warning: ../common/downtime.c, line 669: The scalar variable "result" is
fetched but not initialized. And there may be other such fetches of this
variable that have not been reported in this compilation. (uninit1)
return result;
---------------^

Solution: CHANGED "return result" for "return 0".

2)
cc: Warning: ../xdata/xodtemplate.c, line 2798: The scalar variable
"host_name" is fetched but not initialized. And there may be other such
fetches of this variable that have not been reported in this compilation.
(uninit1)
free(host_name);
-------------------------------------^

Solution: COMMENT the free invocation.

3)
cc: Warning: ../xdata/xodtemplate.c, line 2742: The scalar variable
"host_name" is fetched but not initialized. And there may be other such
fetches of this variable that have not been reported in this compilation.
(uninit1)
free(host_name);
-------------------------------------^

Solution: SAME as ABOVE

4)

cc: Warning: ../xdata/xodtemplate.c, line 5826: In this statement, the
number of conversion specifiers to snprintf exceeds the number of values to
be converted. Conversion specifiers from "%d" onward will process
meaningless and perhaps invalid data. (outtoofew)
snprintf(temp_buffer,sizeof(temp_buffer)-1,"Error:
Could not add contactgroup '%s' to hostgroup escalation (config file '%s',
line
%d)\n",xodtemplate_config_file_name(this_hostgroupescalation->_config_file),this_hostgroupescalation->_start_line);
-------------------------------------------------------------------^

Solution: Changed the '%s' parameter corresponding to "contact
group" to some plain text.

5)

cc: Error: nagios.c, line 296: In the initializer for long_options, an
array's element type is incomplete, which precludes its initialization.
(incompelinit)
{"help",no_argument,0,'h'},
----------------^

Solution: It seems that Tru64 compiler uses the HAVE_GETOPT_H
preprocessor definition but actually dosen't defines the
gnu getopt long functions. So I added a:

#undef HAVE_GETOPT_H

at line 49 (before it is used). This was enough.

I didn't tried yet the resulting files.


Diego Bravo Estrada


_________________________________________________________________
Únase al mayor servicio mundial de correo electrónico:
http://www.hotmail.com/es






This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]