]> git.ipfire.org Git - thirdparty/bind9.git/commit
Enforce type checking for dns_dbnode_t
authorOndřej Surý <ondrej@isc.org>
Tue, 5 Nov 2024 15:13:10 +0000 (16:13 +0100)
committerOndřej Surý <ondrej@isc.org>
Wed, 6 Nov 2024 16:08:04 +0000 (17:08 +0100)
commitfbd5f614d7f52096bfafa0c5f698d63e8718a0c7
tree256ea286809efdd87f54b26d110ed1bcb11eb1eb
parentff94eb9e31fedfb91cf03c0c1ddbc9d6cc8fea4e
Enforce type checking for dns_dbnode_t

Originally, the dns_dbnode_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_dbnode_t;

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

    typedef struct dns_dbnode dns_dbnode_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_dbnode_t type.
bin/named/builtin.c
lib/dns/include/dns/types.h
lib/dns/qpcache.c
lib/dns/qpzone.c
lib/dns/rbt-cachedb.c
lib/dns/rbt-zonedb.c
lib/dns/rbtdb.c
lib/dns/sdlz.c
tests/dns/qpzone_test.c