public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107334] New: Incorrect "infinite recursion detected" warning if base case aborts
@ 2022-10-20 18:03 hugo_musso_gualandi at hotmail dot com
2022-10-20 18:07 ` [Bug middle-end/107334] " mpolacek at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: hugo_musso_gualandi at hotmail dot com @ 2022-10-20 18:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107334
Bug ID: 107334
Summary: Incorrect "infinite recursion detected" warning if
base case aborts
Product: gcc
Version: 12.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: hugo_musso_gualandi at hotmail dot com
Target Milestone: ---
Created attachment 53734
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53734&action=edit
This triggers the -Winfinite-recursion warning
When I compile the attached program with -Winfinite-recursion, GCC 12.2.1 warns
that there is infinite recursion. I expected that it should compile without
warnings. I suspect that the confusion happens because the base case of the
recursive function calls abort().
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/107334] Incorrect "infinite recursion detected" warning if base case aborts
2022-10-20 18:03 [Bug c/107334] New: Incorrect "infinite recursion detected" warning if base case aborts hugo_musso_gualandi at hotmail dot com
@ 2022-10-20 18:07 ` mpolacek at gcc dot gnu.org
2022-10-20 18:08 ` pinskia at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-10-20 18:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107334
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
CC| |mpolacek at gcc dot gnu.org
Ever confirmed|0 |1
Component|c |middle-end
Last reconfirmed| |2022-10-20
Keywords| |diagnostic
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/107334] Incorrect "infinite recursion detected" warning if base case aborts
2022-10-20 18:03 [Bug c/107334] New: Incorrect "infinite recursion detected" warning if base case aborts hugo_musso_gualandi at hotmail dot com
2022-10-20 18:07 ` [Bug middle-end/107334] " mpolacek at gcc dot gnu.org
@ 2022-10-20 18:08 ` pinskia at gcc dot gnu.org
2023-05-01 16:04 ` madhur4127 at gmail dot com
2023-05-01 16:07 ` madhur4127 at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-20 18:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107334
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think the warning message should be clearer really.
Maybe "possible infinite recursion detected" would be better.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/107334] Incorrect "infinite recursion detected" warning if base case aborts
2022-10-20 18:03 [Bug c/107334] New: Incorrect "infinite recursion detected" warning if base case aborts hugo_musso_gualandi at hotmail dot com
2022-10-20 18:07 ` [Bug middle-end/107334] " mpolacek at gcc dot gnu.org
2022-10-20 18:08 ` pinskia at gcc dot gnu.org
@ 2023-05-01 16:04 ` madhur4127 at gmail dot com
2023-05-01 16:07 ` madhur4127 at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: madhur4127 at gmail dot com @ 2023-05-01 16:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107334
Madhur Chauhan <madhur4127 at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |madhur4127 at gmail dot com
--- Comment #2 from Madhur Chauhan <madhur4127 at gmail dot com> ---
*** Bug 109686 has been marked as a duplicate of this bug. ***
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug middle-end/107334] Incorrect "infinite recursion detected" warning if base case aborts
2022-10-20 18:03 [Bug c/107334] New: Incorrect "infinite recursion detected" warning if base case aborts hugo_musso_gualandi at hotmail dot com
` (2 preceding siblings ...)
2023-05-01 16:04 ` madhur4127 at gmail dot com
@ 2023-05-01 16:07 ` madhur4127 at gmail dot com
3 siblings, 0 replies; 5+ messages in thread
From: madhur4127 at gmail dot com @ 2023-05-01 16:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107334
--- Comment #3 from Madhur Chauhan <madhur4127 at gmail dot com> ---
I feel changing the warning text will still cause troubles for people using
-Werror. This forces to use ignore pragmas or disable this warning completely,
none of them are ideal.
Maybe disable warning in this case?
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-05-01 16:07 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-20 18:03 [Bug c/107334] New: Incorrect "infinite recursion detected" warning if base case aborts hugo_musso_gualandi at hotmail dot com
2022-10-20 18:07 ` [Bug middle-end/107334] " mpolacek at gcc dot gnu.org
2022-10-20 18:08 ` pinskia at gcc dot gnu.org
2023-05-01 16:04 ` madhur4127 at gmail dot com
2023-05-01 16:07 ` madhur4127 at gmail dot com
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).