[ntp:hackers] Where did BLOCKING_REQ_MAGIC and BLOCKING_RESP_MAGIC get their values?

Warner Losh imp at bsdimp.com
Mon Jul 29 15:22:01 UTC 2013

MAXINT is signed. Those magic numbers have the top bit set, so are larger than ints, hence the warning.

The magic numbers are needed to make sure the packets are of the proper type, so can't be assigned arbitrarily by the compiler.


On Jul 29, 2013, at 9:18 AM, Brian Utterback wrote:

> I have been trying to get rid of some of the warnings produced when ntpd is compiled. One of the warnings is caused by the fact that the values set for BLOCKING_REQ_MAGIC and BLOCKING_RESP_MAGIC are larger than MAXINT. They are set to 0xb10c7ecf and 0xb10c7e54 respectively. I am not familiar with the code, so I can't be sure, but they look like they are arbitrary values. Do they mean something? If not, why not just let the compiler choose their values when the enum is defined? What am I missing?
> -- 
> blu
> Always code as if the guy who ends up maintaining your code will be a
> violent psychopath who knows where you live. - Martin Golding
> -----------------------------------------------------------------------|
> Brian Utterback - Solaris RPE, Oracle Corporation.
> Ph:603-262-3916, Em:brian.utterback at oracle.com
> _______________________________________________
> hackers mailing list
> hackers at lists.ntp.org
> http://lists.ntp.org/listinfo/hackers

More information about the hackers mailing list