Compiler warnings

Eric S. Raymond esr at thyrsus.com
Thu Jul 11 08:03:02 UTC 2019


Hal Murray via devel <devel at ntpsec.org>:
> 
> Is there a reason that warnings don't default to on?

Yikes, I thought it did.  I remember very clearly cleaning up a
bazillion warnings back in the project's early days.

> When configured with --enable-warnings, I get this on an old gcc.
>   gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-23)
> 
> ../../ntpd/ntp_wrapdate.c: In function 'eval_gps_time':
> ../../ntpd/ntp_wrapdate.c:226: warning: declaration of 'refclock_name'™ 
> shadows a global declaration
> ../../include/ntp_refclock.h:192: warning: shadowed declaration is here
> 
> It looks like a legitimate warning to me.

It is.  Harmless, fortunately.  My fault.  Comes from a recent
refactoring step to isolate some wraparound handling out of the NMEA
driver so other GPS drivers can use it.

> The question is why don't we get similar warnings on newer compilers?

Probably because GCC and clang both keep screwing with the scope of
various warning levels in an attempt to find one that makes everybody
happy.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>




More information about the devel mailing list