From 0d26fb4dac8e1a3822d8362ad651e95c12e1dace Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Thu, 18 Oct 2007 17:02:12 +0000 Subject: 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@ --- usr.bin/pcc/ccom/pftn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'usr.bin/pcc/ccom/pftn.c') 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))) || -- cgit v1.2.3