public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18487] New: Warnings for pure and const functions that are not actually pure or const
@ 2004-11-14 21:37 kazu at cs dot umass dot edu
  2004-11-14 21:57 ` [Bug tree-optimization/18487] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-11-14 21:37 UTC (permalink / raw)
  To: gcc-bugs

It would be nice if GCC can issue warnings for pure or const functions
that are not actually pure or const.

int foo (int) __attribute__ ((pure));
int bar (int) __attribute__ ((const));

int g;

int
foo (int a)
{
  g = a; /* A pure function is not supposed to write to memory.  */
  return 0;
}

int
bar (int a)
{
  return g; /* A const function is not supposed to read memory.  */
}

-- 
           Summary: Warnings for pure and const functions that are not
                    actually pure or const
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org


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


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

end of thread, other threads:[~2004-11-17  0:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-14 21:37 [Bug tree-optimization/18487] New: Warnings for pure and const functions that are not actually pure or const kazu at cs dot umass dot edu
2004-11-14 21:57 ` [Bug tree-optimization/18487] " pinskia at gcc dot gnu dot org
2004-11-16 22:44 ` dberlin at gcc dot gnu dot org
2004-11-17  0:09 ` kazu at cs dot umass dot edu

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).