From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752691AbYATJrK (ORCPT ); Sun, 20 Jan 2008 04:47:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751363AbYATJrA (ORCPT ); Sun, 20 Jan 2008 04:47:00 -0500 Received: from ozlabs.org ([203.10.76.45]:53896 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751221AbYATJq7 (ORCPT ); Sun, 20 Jan 2008 04:46:59 -0500 From: Rusty Russell To: Linus Torvalds Subject: [PATCH 0/6] RFC: Typesafe callbacks Date: Sun, 20 Jan 2008 20:46:13 +1100 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: Andrew Morton , linux-kernel@vger.kernel.org, Jeff Garzik , Tejun Heo MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801202046.14746.rusty@rustcorp.com.au> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi all, Converting to and from void * for callback functions loses type safety: everywhere else we expect the compiler to catch incorrect pointer types handed to functions. It's pretty simple to create typesafe callback functions using typeof, and with a little gcc trickery we can allow both old-style and typesafe callbacks to avoid churn on commonly-used routines. Feedback welcomed, Rusty.