This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/59851] New: Support sparse-style __attribute__((nocast)) (type attribute)
- From: "hpa at zytor dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jan 2014 05:22:32 +0000
- Subject: [Bug c/59851] New: Support sparse-style __attribute__((nocast)) (type attribute)
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59851
Bug ID: 59851
Summary: Support sparse-style __attribute__((nocast)) (type
attribute)
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: hpa at zytor dot com
Created attachment 31862
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31862&action=edit
Example source file
The sparse static C language checker has a type attribute
__attribute__((nocast))
... which issues a warning if a type is implicitly converted unless it is
exactly the same type (changes in constness is permitted, presumably changes in
volatility *should* be permitted as well).
The attached example file produces:
nocast.c:11:24: warning: implicit cast to nocast type
nocast.c:23:24: warning: implicit cast to nocast type