Sujet : Re: C23 thoughts and opinions
De : already5chosen (at) *nospam* yahoo.com (Michael S)
Groupes : comp.lang.cDate : 26. May 2024, 17:50:40
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20240526195040.00001480@yahoo.com>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14
User-Agent : Claws Mail 3.19.1 (GTK+ 2.24.33; x86_64-w64-mingw32)
On Sun, 26 May 2024 18:26:49 +0200
David Brown <
david.brown@hesbynett.no> wrote:
On 26/05/2024 17:05, Michael S wrote:
In my environment it applies to gcc, but not to g++.
In order to force my g++ to compile for other language you have to
tell it so explicitly.
No, g++ treats extensions other than ".c" the same way as gcc. (I
tested to be sure this time!) Try :
touch foo.f
gcc foo.f
g++ foo.f
You'll get the same complaint - either from missing Fortran support
or a failure to build the Fortran program. Even "g++ foo.m" tries to
compile as Objective-C, not Objective-C++.
Yes, I paid attention that for suffix .f (and probably for .ada) gcc
and g++ behave identically only after I posted my response.
BTW, it seems to me that here behavior of gcc/g++ is different from
gfortran. If I am not mistaken, gfortran by default treats extension .f
as "old FORTRAN" and extension .f90 as "new Fortran". But I can be
wrong about it, New Fortran is not something I compile regularly and
old FORTRAN is not something that I compile ever.