Date: Wed, 3 May 2000 14:37:04 +0900 (JST) From: shigio@tamacom.com To: FreeBSD-gnats-submit@freebsd.org Subject: kern/18364: Bad function definition. Message-ID: <200005030537.OAA63004@tamacom.com>
next in thread | raw e-mail | index | archive | help
>Number: 18364 >Category: kern >Synopsis: Bad function definition using #define. >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue May 2 22:50:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Shigio Yamaguchi >Release: FreeBSD 3.4-RELEASE i386 >Organization: Tama Communications corporation >Environment: >Description: Some functions use a macro SYSCTL_HANDLER_ARGS but no tag command can detect them as functions, because function's braces are hidden in the macro. SYSCTL_HANDLER_ARGS is like this: #define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int ar struct sysctl_req *req) ... int sysctl_handle_int SYSCTL_HANDLER_ARGS; Instead, it should be like this: #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg struct sysctl_req *req ... int sysctl_handle_int (SYSCTL_HANDLER_ARGS); >How-To-Repeat: no >Fix: --------------------------------------------------------------------- [/usr/src/sys/sys/sysctl.h] --------------------------------------------------------------------- #define SYSCTL_HANDLER_ARGS (struct sysctl_oid *oidp, void *arg1, int arg2, \ struct sysctl_req *req) ... int sysctl_handle_int SYSCTL_HANDLER_ARGS; int sysctl_handle_long SYSCTL_HANDLER_ARGS; int sysctl_handle_intptr SYSCTL_HANDLER_ARGS; int sysctl_handle_string SYSCTL_HANDLER_ARGS; int sysctl_handle_opaque SYSCTL_HANDLER_ARGS; | v #define SYSCTL_HANDLER_ARGS struct sysctl_oid *oidp, void *arg1, int arg2, \ struct sysctl_req *req ... int sysctl_handle_int (SYSCTL_HANDLER_ARGS); int sysctl_handle_long (SYSCTL_HANDLER_ARGS); int sysctl_handle_intptr (SYSCTL_HANDLER_ARGS); int sysctl_handle_string (SYSCTL_HANDLER_ARGS); int sysctl_handle_opaque (SYSCTL_HANDLER_ARGS); --------------------------------------------------------------------- [/usr/src/sys/kern/kern_sysctl.c] --------------------------------------------------------------------- int sysctl_handle_int SYSCTL_HANDLER_ARGS { int error = 0; ... } | v int sysctl_handle_int (SYSCTL_HANDLER_ARGS) { int error = 0; ... } ... >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200005030537.OAA63004>