public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
[parent not found: <bug-18487-5009@http.gcc.gnu.org/bugzilla/>]
* [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; 25+ 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] 25+ messages in thread

end of thread, other threads:[~2023-05-09 18:07 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-18487-4@http.gcc.gnu.org/bugzilla/>
2015-01-21 22:56 ` [Bug tree-optimization/18487] Warnings for pure and const functions that are not actually pure or const pinskia at gcc dot gnu.org
2015-01-21 22:58 ` pinskia at gcc dot gnu.org
2015-01-22  0:44 ` dmalcolm at gcc dot gnu.org
2015-01-22  0:47 ` dmalcolm at gcc dot gnu.org
2015-01-22  7:07 ` jakub at gcc dot gnu.org
2015-01-22  7:17 ` jakub at gcc dot gnu.org
2020-05-05 19:08 ` msebor at gcc dot gnu.org
2021-01-15 20:30 ` federico.kircheis at gmail dot com
2021-06-18 17:05 ` pinskia at gcc dot gnu.org
2021-06-18 17:07 ` pinskia at gcc dot gnu.org
2021-06-18 17:52 ` msebor at gcc dot gnu.org
2021-09-04 12:55 ` dberlin at gcc dot gnu.org
2021-09-04 20:27 ` federico.kircheis at gmail dot com
2021-09-04 20:34 ` federico.kircheis at gmail dot com
2021-09-04 20:40 ` federico.kircheis at gmail dot com
2021-09-04 20:57 ` dberlin at gcc dot gnu.org
2021-09-04 22:25 ` federico.kircheis at gmail dot com
2022-01-26 17:04 ` msebor at gcc dot gnu.org
2023-05-09 18:07 ` pinskia at gcc dot gnu.org
     [not found] <bug-18487-5009@http.gcc.gnu.org/bugzilla/>
2007-08-11 17:55 ` pinskia at gcc dot gnu dot org
2007-08-13  5:41 ` gnu at behdad dot org
2008-08-08 21:02 ` pinskia at gcc dot gnu dot org
2004-11-14 21:37 [Bug tree-optimization/18487] New: " 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).