summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-01-03 20:26:37 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-01-03 20:26:37 +0000
commit0eff5d780d638305664a5632c7a53e52b249c292 (patch)
tree593b4518ac7c7e300ce1d5bebe5a3ffffcdd1798 /usr.bin
parent0d646af6fcf80c9805a79148a17f823044cd631a (diff)
Silence a gcc warning: "initialization from incompatible pointer type"
The problem is that while ANSI C allows initialization of unions, the initializer must be valid for the first member of the union. Therefore, add a cast to quiet the compiler. Noticed and Ok pvalchev@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mail/cmdtab.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.bin/mail/cmdtab.c b/usr.bin/mail/cmdtab.c
index 69bf6a9ec75..2b9008bc736 100644
--- a/usr.bin/mail/cmdtab.c
+++ b/usr.bin/mail/cmdtab.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmdtab.c,v 1.7 2003/06/03 02:56:11 millert Exp $ */
+/* $OpenBSD: cmdtab.c,v 1.8 2004/01/03 20:26:36 millert Exp $ */
/* $NetBSD: cmdtab.c,v 1.7 1996/12/28 07:10:59 tls Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static const char sccsid[] = "@(#)cmdtab.c 8.2 (Berkeley) 4/20/95";
#else
-static const char rcsid[] = "$OpenBSD: cmdtab.c,v 1.7 2003/06/03 02:56:11 millert Exp $";
+static const char rcsid[] = "$OpenBSD: cmdtab.c,v 1.8 2004/01/03 20:26:36 millert Exp $";
#endif
#endif /* not lint */
@@ -46,6 +46,7 @@ static const char rcsid[] = "$OpenBSD: cmdtab.c,v 1.7 2003/06/03 02:56:11 miller
*
* Define all of the command names and bindings.
*/
+typedef int (*cfunc_t)(void *);
const struct cmd cmdtab[] = {
/* msgmask msgflag */
/* command function argtype result & mask */
@@ -67,8 +68,8 @@ const struct cmd cmdtab[] = {
{ "unset", { unset }, M|RAWLIST, 1, 1000 },
{ "mail", { sendmail }, R|M|I|STRLIST, 0, 0 },
{ "mbox", { mboxit }, W|MSGLIST, 0, 0 },
- { "pipe", { pipeit }, MSGLIST|STRLIST,0, MMNDEL },
- { "|", { pipeit }, MSGLIST|STRLIST,0, MMNDEL },
+ { "pipe", { (cfunc_t)pipeit }, MSGLIST|STRLIST,0, MMNDEL },
+ { "|", { (cfunc_t)pipeit }, MSGLIST|STRLIST,0, MMNDEL },
{ "more", { more }, MSGLIST, 0, MMNDEL },
{ "page", { more }, MSGLIST, 0, MMNDEL },
{ "More", { More }, MSGLIST, 0, MMNDEL },