]> git.ipfire.org Git - thirdparty/bind9.git/commit
Enforce type checking for dns_dbversiont_t
authorOndřej Surý <ondrej@isc.org>
Tue, 5 Nov 2024 17:50:15 +0000 (18:50 +0100)
committerOndřej Surý <ondrej@isc.org>
Thu, 7 Nov 2024 07:03:55 +0000 (08:03 +0100)
commit8a38c17ccadc4ec500b2187b3bb6d1d86e6437f0
tree9e301cc173f3a94938cb7d317d754b79ac3fdc28
parente8e1246dda10793a0192e8d33bbacf584f5ae2d9
Enforce type checking for dns_dbversiont_t

Originally, the dns_dbversion_t was typedef'ed to void type.  This
allowed some flexibility, but using (void *) just removes any
type-checking that C might have.  Instead of using:

    typedef void dns_dbversion_t;

use a trick to define the type to non-existing structure:

    typedef struct dns_dbversion dns_dbversion_t;

This allows the C compilers to employ the type-checking while the
structure itself doesn't have to be ever defined because the actual
'storage' is never accessed using dns_dbversion_t type.
bin/named/builtin.c
lib/dns/include/dns/types.h
lib/dns/qpzone.c
lib/dns/rbt-zonedb.c
lib/dns/rbtdb.c
lib/dns/sdlz.c
lib/dns/zone.c