[ntp:hackers] Odd warning in ntp_rfc2553.c

Brian Utterback brian.utterback at sun.com
Fri May 20 07:40:51 PDT 2005


I am working on integrating NTP V4 into Solaris, which at this
stage mostly means morphing the directory structure and Makefiles
to conform to our internal build requirements.

Anyway, I get this warning when compiling ntp_rfc2553.c:

ntp_rfc2553.c", line 287: warning: const object should have initializer: 
isc_net_in6addrany (E_CONST_OBJ_SHOULD_HAVE_INITIZR)

This seems to be due to this section of code:

#if defined(SYS_WINNT)
/* XXX This is the preferred way, but for some reason the SunOS compiler
  * does not like it.
  */
const struct in6_addr in6addr_any = IN6ADDR_ANY_INIT;
#else
const struct in6_addr in6addr_any;
#endif


Now, granted, we set the compilers to issue warnings about a lot
of things, and I don't get this error if I turn off all the
checking, but I am intrigued about how to resolve this. I have tried
the oldest Sun Compiler I can find, and they all ignore this
problem without the error checking and flag it with the error
checking. No version I can find complains the other way.

So, I have to assume that the comment is from older SunOS 4.x
compilers. Now, my problem is two fold. It is my desire to
make the compile run clean, but also to reduce my down stream
maintenance. To that end, any changes I need to make, I would like
to see also made in the ntp-dev code base, so that I do not have
to go through this whole thing at every code release. But, I
don't see any obvious flags that I can check for to add to the
ifdef that will use the first version on Solaris and the second
on SunOS. In fact, it seems odd to me that what the comment
calls the "preferred way" is only used on WINNT. Shouldn't
the sense of the ifdef be the other way around so that
only SunOS uses the line without the initializer? There are
comments in the distribution about the desire to remove
the obvious choice, SYS_SOLARIS, and as near as I can tell,
this symbol isn't set anyway. So, any ideas about what to do
and why this ifdef is there in the first place?

What is the status of support of SunOS anyway? Could we just get
rid of the whole ifdef?

-- 
blu

Due to heavy processing demand, we are currently using some of your
unused brain capacity for backup processing. Please ignore any
hallucinations, voices or unusual dreams you may experience. Please
avoid concentration-intensive tasks until further notice. Thank you.
----------------------------------------------------------------------
Brian Utterback - OP/N1 RPE, Sun Microsystems, Inc.
Ph:877-259-7345, Em:brian.utterback-at-ess-you-enn-dot-kom



More information about the hackers mailing list