Re: Modify the gcc exit code for warning

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 29 May 2022, 18:01 disquisitiones via Gcc-help, <
gcc-help@xxxxxxxxxxx> wrote:

> Hi and thanks for the hint.
>
> I've determined that the following function defined in gcc/gcc.cc (in
> my understanding the source code related to g++)
>
>
> */* Determine what the exit code of the driver should be.  */*
>
>
> *intdriver::get_exit_code () const { ... }*
>
> is responsible for the return value of g++.
>
> The "warningcount" macro evaluates from the diagnostic context the
> number of warnings generated in the compilation.
>
> The problem is that the warningcount macro evaluates correctly in
> cc1plus but always evaluates to 0 in g++, so it's not
> possible to solve the problem modifying only this function.
>
> So I think that the information about the warning count is lost from
> the diagnostic context of cc1plus
> and the diagnostic context available to g++.
>
> Given that g++ and cc1plus are different applications, I assume that
> cc1plus passes the diagnostic context back to g++ via some temporary
> file.
>

No, the g++ driver spawns a child process to run the cc1plus program, then
the parent waits for the child to exit and gets the exit status from the OS.


And maybe the point could be to make cc1plus update also the warning
> count information in this file, so that it will be available to g++.
>

There is no file.


> Am I on the right track? If so, any hint on where cc1plus stores the
> diagnostic context in this temporary file for g++?
>


Learn about how the fork, exec, and wait functions work. The exit status of
a child process is available to the parent process.



>
>



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux