From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28720 invoked by alias); 17 Jan 2014 05:05:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 28675 invoked by uid 48); 17 Jan 2014 05:05:14 -0000 From: "hpa at zytor dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/59850] New: Support sparse-style pointer address spaces (type attributes) Date: Fri, 17 Jan 2014 05:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: hpa at zytor dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-01/txt/msg01797.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59850 Bug ID: 59850 Summary: Support sparse-style pointer address spaces (type attributes) Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: hpa at zytor dot com The sparse C compile checker has a set of extensions to the gcc type attribute set: __attribute__((noderef)) __attribute__((address_space(N))) ... where N is an arbitrary integer. sparse will warn if pointers tagged with different address spaces are mixed, and if a pointer tagged with "noderef" is dereferenced. It would be highly useful if these protections could be extended to gcc itself and thus get more ubiquitously run. The main use case, of course, is the Linux kernel, but almost any low-level application which has to deal with multiple "manually maintained" address spaces is likely to benefit. __attribute__((force)) ... usually used as part of a cast, is used to suppress the warning.