[Patch, fortran, 4.9] Use bool type instead gfc_try
N.M. Maclaren
nmm1@cam.ac.uk
Fri Mar 22 11:14:00 GMT 2013
On Mar 22 2013, Tobias Burnus wrote:
>
>The front end and the backend are both compiled with the same compiler
>and in the same binary. Even without bootstrapping, trying to compile
>them with different compilers, will require some heavy editing of
>makefiles. Thus, it seems to be extremely unlikely that different
>compilers have ever been used. The change from C99's bool to C++'s bool
>occurred for the whole compiler. Before 4.7 the default was to compile
>GCC with C (though it had been modified to be also compilable with C++);
>in 4.7, the default compiler was C++ but C was still supported. And
>since GCC 4.8 C++ features are used, which makes GCC only compilable
>with C++. Actually, the FE itself so far uses nearly no C++ features, it
>is the middle end which used them (which 'leak' to the front end via
>some helper macros/functions).
Ah. I misunderstood what people said. Yes, if C++ mode is used for
the whole compiler, everything is fine. And it remains so even if
the code plays fairly clever games. I don't know if there are any
compilers that generate incompatible bool types in C and C++ modes,
but it wouldn't surprise me if there were.
>In terms of the discussion, "bool" is used for quite some time in
>gfortran (the frontend) and libgfortran. When GCC was compiled with C,
>that was C99's _Bool. Since the compiler is compiled as C++, it is C++'s
>"bool". Thus, C/C++'s bool are never mixed.
Then there is no problem. Sorry about the red herring - I misunderstood
what people said. Unfortunately, from personal experience, the majority
of people even on WG14 and WG21 do not understand the incompatibilities,
which is why I posted.
Regards,
Nick Maclaren.
More information about the Gcc-patches
mailing list