From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Robert P. J. Day" Subject: any compelling reasons to use "offsetof"? Date: Thu, 18 Aug 2005 10:21:50 -0400 (EDT) Message-ID: Mime-Version: 1.0 Return-path: Sender: linux-c-programming-owner@vger.kernel.org List-Id: Content-Type: TEXT/PLAIN; charset="us-ascii" Content-Transfer-Encoding: 7bit To: C programming list in a legacy project i just inherited, i did a quick recursive grep and noticed a number of invocations of "offsetof". from experience, i've concluded that the majority of these calls are because of sloppy programming or laziness or just plain doing something incredibly hacky that could be done in a more straightforward way. are there any really compelling reasons to need to know the offset of a structure field? just curious. rday