Re: Modify the gcc exit code for warning

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

 



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

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


Thanks,

Luca



On Thu, May 26, 2022 at 2:35 AM disquisitiones via Gcc-help
<gcc-help@xxxxxxxxxxx> wrote:
>>* I would like to modify the exit code returned by gcc in case of warning
*>* from 0 to some other value, but I'm not familiar with the gcc large source
*>* code base.
*>>* Could you provide an hint to which is the file in the gcc source code that
*>* I should modify for modifying the exit value?
*
Try to find out where -Werror gets handled. This will lead you to the
correct places.


Il giorno gio 26 mag 2022 alle ore 02:35 disquisitiones <
disquisitiones@xxxxxxxxx> ha scritto:

> Hi,
>
> I would like to modify the exit code returned by gcc in case of warning
> from 0 to some other value, but I'm not familiar with the gcc large source
> code base.
>
> Could you provide an hint to which is the file in the gcc source code that
> I should modify for modifying the exit value?
>
> Many thanks,
>
> Luca
>



[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