summaryrefslogtreecommitdiff
path: root/usr.bin/pcc/ccom/pftn.c
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2007-10-18 17:02:12 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2007-10-18 17:02:12 +0000
commit0d26fb4dac8e1a3822d8362ad651e95c12e1dace (patch)
treeb62fb748f35bf89f8c0b68335481ca8ac0116d96 /usr.bin/pcc/ccom/pftn.c
parentb190e65fd18284efd3361cee55aba4d8d04d55a4 (diff)
Kill spurious warnings when arg is a function pointer. Should
actually check the return type and arg list of the function pointer arg. ok ragge@
Diffstat (limited to 'usr.bin/pcc/ccom/pftn.c')
-rw-r--r--usr.bin/pcc/ccom/pftn.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/pcc/ccom/pftn.c b/usr.bin/pcc/ccom/pftn.c
index 7e62929917d..baab75fcdbf 100644
--- a/usr.bin/pcc/ccom/pftn.c
+++ b/usr.bin/pcc/ccom/pftn.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pftn.c,v 1.3 2007/10/12 17:03:14 otto Exp $ */
+/* $OpenBSD: pftn.c,v 1.4 2007/10/18 17:02:11 otto Exp $ */
/*
* Copyright (c) 2003 Anders Magnusson (ragge@ludd.luth.se).
* All rights reserved.
@@ -2303,6 +2303,11 @@ incomp: uerror("incompatible types for arg %d",
goto out;
}
+ /* XXX should (recusively) check return type and arg list of
+ func ptr arg XXX */
+ if (ISFTN(DECREF(arrt)) && ISFTN(type))
+ type = INCREF(type);
+
/* Hereafter its only pointers (or arrays) left */
/* Check for struct/union intermixing with other types */
if (((type <= BTMASK) && ISSOU(BTYPE(type))) ||