This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran, 4.9] Use bool type instead gfc_try


On Thu, 21 Mar 2013, N.M. Maclaren wrote:

> On Mar 19 2013, Tobias Burnus wrote:
> > Am 19.03.2013 13:15, schrieb Janne Blomqvist:
> > 
> > > now that the Fortran frontend is C++ we can use the primitive bool
> > > type instead of inventing our own.
> > 
> > Well, C99's "bool" (_Bool) was already used before. ...
> 
> Er, that is making a serious mistake or, at least, running the risk of
> one.  C++'s bool and C99's _Bool are NOT compatible types.  The UK tried
> to get _Bool either made compatible with C++ or (preferably) dropped, but
> failed in both.

They have been ABI-compatible in GCC ever since I implemented C99 _Bool 
(as opposed to the different, incompatible version in earlier C9X drafts) 
in <http://gcc.gnu.org/ml/gcc-patches/2000-10/msg01127.html>, and the 
semantics are essentially the same except that C++ disallows decrement 
operators (prefix and postfix --) on bool and C allows them.  (I don't 
know what C++ specifies regarding bool bit-fields or whether there are any 
incompatibilities there, but for non-bit-field objects you shouldn't have 
problems.)

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]