public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jg at jguk dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101052] New: Suggest stdlib.h when exit(1) is called
Date: Sun, 13 Jun 2021 22:24:50 +0000 [thread overview]
Message-ID: <bug-101052-4@http.gcc.gnu.org/bugzilla/> (raw)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101052
Bug ID: 101052
Summary: Suggest stdlib.h when exit(1) is called
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jg at jguk dot org
Target Milestone: ---
>From godbolt GCC trunk 13 June 2021
Could #include <stdlib.h> be suggested please.
-Wall -O2
123
<Compilation failed>
# For more information see the output window
x86-64 gcc (trunk) - 322ms
#1 with x86-64 gcc (trunk)
<source>: In function 'void f(int*)':
<source>:8:9: error: 'exit' was not declared in this scope
8 | exit(1);
| ^~~~
Compiler returned: 1
//#include <stdlib.h>
#include <cstddef>
void f(int * g)
{
if(NULL == g)
{
exit(1);
}
}
next reply other threads:[~2021-06-13 22:24 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-13 22:24 jg at jguk dot org [this message]
2021-06-13 22:25 ` [Bug c++/101052] " jg at jguk dot org
2021-06-14 10:43 ` redi at gcc dot gnu.org
2021-06-14 15:35 ` redi at gcc dot gnu.org
2021-06-14 17:24 ` cvs-commit at gcc dot gnu.org
2021-06-14 17:25 ` redi at gcc dot gnu.org
2021-06-14 17:26 ` redi at gcc dot gnu.org
2021-06-14 18:06 ` jg at jguk dot org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-101052-4@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).