public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/35069]  New: Casting from a volatile type to a non-volatile type should cause a warning
@ 2008-02-04  1:33 gcc-david at tulloh dot id dot au
  2008-02-04  5:19 ` [Bug c/35069] " gcc-david at tulloh dot id dot au
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gcc-david at tulloh dot id dot au @ 2008-02-04  1:33 UTC (permalink / raw)
  To: gcc-bugs

Given the following code:

volatile int16_t foo;
x = (int32_t)foo;

The above cast should almost certainly have been (volatile int32_t), I see no
obvious case where someone would want to cast away the volatile attribute.

I suggest that a cast that drops a volatile attribute from a variable should
cause a warning.


(Epiphany occurred at the end of a frustrating day, was using gcc 4.2.2
targeting an AVR)


-- 
           Summary: Casting from a volatile type to a non-volatile type
                    should cause a warning
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-david at tulloh dot id dot au


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35069


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-14 23:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-04  1:33 [Bug c/35069] New: Casting from a volatile type to a non-volatile type should cause a warning gcc-david at tulloh dot id dot au
2008-02-04  5:19 ` [Bug c/35069] " gcc-david at tulloh dot id dot au
2008-02-04  9:11 ` pinskia at gcc dot gnu dot org
2008-02-04 22:14 ` gcc-david at tulloh dot id dot au
2008-02-04 22:17 ` pinskia at gcc dot gnu dot org
2008-11-14 23:56 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).