From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9334 invoked by alias); 15 Jun 2010 01:20:27 -0000 Received: (qmail 9325 invoked by uid 22791); 15 Jun 2010 01:20:26 -0000 X-SWARE-Spam-Status: No, hits=-5.1 required=5.0 tests=AWL,BAYES_05,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jun 2010 01:20:17 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o5F1K9XP029061 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Jun 2010 21:20:10 -0400 Received: from greed.delorie.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o5F1K6DI023499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jun 2010 21:20:08 -0400 Received: from greed.delorie.com (greed.delorie.com [127.0.0.1] (may be forged)) by greed.delorie.com (8.14.3/8.14.3) with ESMTP id o5F1K5ff024502; Mon, 14 Jun 2010 21:20:05 -0400 Received: (from dj@localhost) by greed.delorie.com (8.14.3/8.14.3/Submit) id o5F1K5wj024499; Mon, 14 Jun 2010 21:20:05 -0400 Date: Tue, 15 Jun 2010 02:40:00 -0000 Message-Id: <201006150120.o5F1K5wj024499@greed.delorie.com> From: DJ Delorie To: Mark Mitchell CC: joseph@codesourcery.com, gcc-patches@gcc.gnu.org In-reply-to: <4C12D8DA.5070507@codesourcery.com> (message from Mark Mitchell on Fri, 11 Jun 2010 17:46:18 -0700) Subject: Re: patch: honor volatile bitfield types References: <201006110338.o5B3cuA3031982@greed.delorie.com> <201006111352.o5BDqnnh013901@greed.delorie.com> <4C126123.2060004@codesourcery.com> <201006112204.o5BM4wsk031264@greed.delorie.com> <4C12D8DA.5070507@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2010-06/txt/msg01465.txt.bz2 > And, the field name should definitely be mentioned if at all > possible. Sigh, not possible without major code changes. This is the problem I ran into writing the patch itself - the decls are all long since lost by the time we get to these routines, and some of the paths that lead to them make it very difficult to keep track of them (if they're available at all). How's this for the message? if (bitsize == total_bits) warning (0, "mis-aligned access used for structure member"); else warning (0, "mis-aligned access used for structure bitfield"); if (! warned_about_misalignment) { warned_about_misalignment = true; warning (0, "volatile objects require a single access to preserve their" " volatility, but this member spans multiple type-sized locations." " Normally the compiler would use multiple accesses for such fields" " to avoid mis-aligned accesses. This code may fail at runtime") }