public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/101052] New: Suggest stdlib.h when exit(1) is called
@ 2021-06-13 22:24 jg at jguk dot org
  2021-06-13 22:25 ` [Bug c++/101052] " jg at jguk dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jg at jguk dot org @ 2021-06-13 22:24 UTC (permalink / raw)
  To: gcc-bugs

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);
    }
}

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

end of thread, other threads:[~2021-06-14 18:06 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-13 22:24 [Bug c++/101052] New: Suggest stdlib.h when exit(1) is called jg at jguk dot org
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

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