From owner-svn-src-head@FreeBSD.ORG Wed Feb 26 01:35:58 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 131B827D; Wed, 26 Feb 2014 01:35:58 +0000 (UTC) Received: from mail-ig0-x22c.google.com (mail-ig0-x22c.google.com [IPv6:2607:f8b0:4001:c05::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9D0A01464; Wed, 26 Feb 2014 01:35:57 +0000 (UTC) Received: by mail-ig0-f172.google.com with SMTP id h3so8937493igd.5 for ; Tue, 25 Feb 2014 17:35:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=mN3BJeLNM8+YOX2Pf7DSEi1JUtejn6sPkLdqP6j0Yag=; b=AOa5RNNIk63x5sP9sopEBz8rfL0jjc58wRJvLoS5MJGqaWggj+77t70TiBmA2kfnz/ TkOK+ubGpMdZ1z7UoJGk9eWPId9SCvPvIMIZYQeNjauRo69wYZ3yc8NQrEiavo+Vesrd ZFI+JHKOr/nc0kuuEJjcsla1PYNKpohHTtlIRgPGYWVzaMofhvtStr+KtmtoMSKET/bj wAZvTKoXab0tBEW9RayF38erphKyHK3RAwamS6WhciIMEjuOEl+sIy28yFpVcr2/AA1F Czgrmd7k3kdOpj/BKSbr/S1I5EDcpJz9S8Ysy8RZUp/2MI2pFt3lccOjvx6m8fviiJLr 4NcA== X-Received: by 10.42.129.9 with SMTP id o9mr3029768ics.38.1393378556936; Tue, 25 Feb 2014 17:35:56 -0800 (PST) Received: from raichu (198-84-185-216.cpe.teksavvy.com. [198.84.185.216]) by mx.google.com with ESMTPSA id gd5sm778738igd.5.2014.02.25.17.35.55 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2014 17:35:56 -0800 (PST) Sender: Mark Johnston Date: Tue, 25 Feb 2014 20:35:50 -0500 From: Mark Johnston To: Justin Hibbits Subject: Re: svn commit: r262466 - head/sys/cddl/dev/systrace Message-ID: <20140226013550.GA16841@raichu> References: <201402250258.s1P2wCDd060659@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Feb 2014 01:35:58 -0000 On Tue, Feb 25, 2014 at 03:17:56PM -0800, Justin Hibbits wrote: > I think this broke powerpc building. I see the following build failure: > > cc1: warnings being treated as errors > /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c: > In function 'systrace_probe': > /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: > warning: function called through a non-compatible type > /home/chmeee/freebsd/head/sys/modules/dtrace/systrace/../../../cddl/dev/systrace/systrace.c:218: > note: if this code is reached, the program will abort > Hi Justin, Sorry about this. I've reverted the commit. I realize that the change introduced undefined behaviour, but a similar trick is used elsewhere in the DTrace code to pass extra arguments at a probe site. Calling dtrace_probe() through a function pointer (patch below) makes the warning go away, but I don't really understand why. clang doesn't emit warnings in either case. Thanks, -Mark diff --git a/sys/cddl/dev/systrace/systrace.c b/sys/cddl/dev/systrace/systrace.c index 83f0793..5f4b82f 100644 --- a/sys/cddl/dev/systrace/systrace.c +++ b/sys/cddl/dev/systrace/systrace.c @@ -168,8 +168,8 @@ static dtrace_pops_t systrace_pops = { static struct cdev *systrace_cdev; static dtrace_provider_id_t systrace_id; -typedef void (*systrace_dtrace_probe)(dtrace_id_t, uintptr_t, uintptr_t, - uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); +typedef void (*systrace_probe_t)(dtrace_id_t, uintptr_t, uintptr_t, uintptr_t, + uintptr_t, uintptr_t, uintptr_t, uintptr_t, uintptr_t); #if !defined(LINUX_SYSTRACE) /* @@ -214,8 +214,9 @@ systrace_probe(u_int32_t id, int sysnum, struct sysent *sysent, void *params, } /* Process the probe using the converted argments. */ - ((systrace_dtrace_probe)(dtrace_probe))(id, uargs[0], uargs[1], - uargs[2], uargs[3], uargs[4], uargs[5], uargs[6], uargs[7]); + systrace_probe_t probe = (systrace_probe_t)dtrace_probe; + probe(id, uargs[0], uargs[1], uargs[2], uargs[3], uargs[4], + uargs[5], uargs[6], uargs[7]); } #endif