Maintained by: NLnet Labs

Incomplete prototype

W.C.A. Wijngaards
Mon Sep 5 09:25:12 CEST 2016


Hi Dag-Erling,

Yes that is wrong.  I fixed the incomplete prototypes for those
functions.  Thanks for the report, this makes the code more
standards-compliant.

Best regards, Wouter

On 03/09/16 17:33, Dag-Erling Smørgrav via Unbound-users wrote:
> The prototype for ub_event_get_version() in util/ub_event.h is missing
> an argument list.  C11 allows function definitions to have empty
> argument lists but not prototypes.  Patch relative to tip of svn tree:
> 
> Index: util/ub_event.h
> ===================================================================
> --- util/ub_event.h	(revision 3846)
> +++ util/ub_event.h	(working copy)
> @@ -63,7 +63,7 @@
>   * daemon compile, and will be "pluggable-event<PACKAGE_VERSION>" for 
>   * libunbound.
>   */
> -const char* ub_event_get_version();
> +const char* ub_event_get_version(void);
>  /** Return the name, system and method for the pluggable event base */
>  void ub_get_event_sys(struct ub_event_base*, const char** n, const char** s,
>  	const char** m);
> 
> The definitions in util/ub_event.c and util/ub_event_pluggable.c don't
> have argument lists, which is perfectly fine from the standard's point
> of view, although I would have provided one as a matter of principle.
> 
> Full list of function definitions with empty argument lists in Unbound:
> 
> daemon/unbound.c		static void usage()
> dns64/dns64.c			dns64_get_funcblock()
> smallapp/unbound-anchor.c	usage()
> smallapp/unbound-checkconf.c	usage()
> smallapp/unbound-control.c	usage()
> smallapp/unbound-host.c		usage()
> testcode/lock_verify.c		usage()
> testcode/memstats.c		usage()
> testcode/petal.c		usage()
> testcode/signit.c		usage()
> testcode/testbound.c		testbound_usage()
> testcode/testpkts.c		static struct entry* new_entry()
> util/storage/lookup3.c		void driver1()
> util/storage/lookup3.c		void driver2()
> util/storage/lookup3.c		void driver3()
> util/storage/lookup3.c		int main()
> util/ub_event.c			const char* ub_event_get_version()
> util/ub_event_pluggable.c	const char* ub_event_get_version()
> winrc/win_svc.c			set_cron_timer()
> 
> DES
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://unbound.nlnetlabs.nl/pipermail/unbound-users/attachments/20160905/462d55bc/attachment.sig>