public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source)
       [not found] <bug-12411-4@http.gcc.gnu.org/bugzilla/>
@ 2020-05-12 22:12 ` rafael at espindo dot la
  2021-08-24  6:15 ` [Bug c/12411] " pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: rafael at espindo dot la @ 2020-05-12 22:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12411

Rafael Avila de Espindola <rafael at espindo dot la> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rafael at espindo dot la

--- Comment #7 from Rafael Avila de Espindola <rafael at espindo dot la> ---
I think we just hit a case similar to this bug where it would be nice get a
warning.

Given

-------------------------
struct foo {
    void bar(int);
};
foo get_foo(int);
void g() {
    int a = 0;
    get_foo(a).bar(a++);
}
------------------------

GCC will warn about the value of a. If instead of an integer we have an object,
like in

--------------------------------
#include <utility>
struct zed {
    zed();
    zed(const zed&);
    zed(zed&&);
};
struct foo {
    void bar(zed);
};
foo get_foo(zed);
void g() {
    zed a;
    get_foo(a).bar(std::move(a));
}
--------------------------------

GCC produces no warning.

Let me know if I should report a new bug instead.

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

* [Bug c/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source)
       [not found] <bug-12411-4@http.gcc.gnu.org/bugzilla/>
  2020-05-12 22:12 ` [Bug other/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source) rafael at espindo dot la
@ 2021-08-24  6:15 ` pinskia at gcc dot gnu.org
  2024-03-28  5:35 ` pinskia at gcc dot gnu.org
  2024-03-29 16:34 ` egallager at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-24  6:15 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12411

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
          Component|other                       |c
             Status|NEW                         |RESOLVED
           Severity|normal                      |enhancement

--- Comment #8 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So thinking about this, I highly doubt we want to warn about this case as it is
hard to even know what we are warning about if two functions have side effects
that matter which order they are in.

Anyways I filed this bug report so I am closing as won't fix.

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

* [Bug c/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source)
       [not found] <bug-12411-4@http.gcc.gnu.org/bugzilla/>
  2020-05-12 22:12 ` [Bug other/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source) rafael at espindo dot la
  2021-08-24  6:15 ` [Bug c/12411] " pinskia at gcc dot gnu.org
@ 2024-03-28  5:35 ` pinskia at gcc dot gnu.org
  2024-03-29 16:34 ` egallager at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-28  5:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12411

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vt at altlinux dot org

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 114507 has been marked as a duplicate of this bug. ***

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

* [Bug c/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source)
       [not found] <bug-12411-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2024-03-28  5:35 ` pinskia at gcc dot gnu.org
@ 2024-03-29 16:34 ` egallager at gcc dot gnu.org
  3 siblings, 0 replies; 4+ messages in thread
From: egallager at gcc dot gnu.org @ 2024-03-29 16:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12411

--- Comment #10 from Eric Gallager <egallager at gcc dot gnu.org> ---
I think the dup is a point for reopening

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

end of thread, other threads:[~2024-03-29 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-12411-4@http.gcc.gnu.org/bugzilla/>
2020-05-12 22:12 ` [Bug other/12411] Missed -Wsequence-point on functions (example reduced from historical GCC source) rafael at espindo dot la
2021-08-24  6:15 ` [Bug c/12411] " pinskia at gcc dot gnu.org
2024-03-28  5:35 ` pinskia at gcc dot gnu.org
2024-03-29 16:34 ` egallager at gcc dot gnu.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).