From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10ba33,f704b2e0101a3ae6 X-Google-Attributes: gid10ba33,public X-Google-Thread: fee84,77653ffe51c35a24 X-Google-Attributes: gidfee84,public From: jason@cygnus.com (Jason Merrill) Subject: Re: gcc 2.7.2, ld warnings on Digital UNIX v3.2 Date: 1996/05/08 Message-ID: #1/1 X-Deja-AN: 153756316 sender: jason@yorick.cygnus.com references: <4ktph9$o2n@odo.amherst.com> <4kubph$b90@vertex.tor.hookup.net> content-type: text/plain; charset=US-ASCII organization: Cygnus Support, Mountain View, CA mime-version: 1.0 newsgroups: comp.unix.osf.osf1,gnu.g++.help >>>>> Phil Edwards writes: > 1) I never asked GNU to automatically link the math library. Just > because I'm using C++ instead of C doesn't imply that I require the > hefty math functions present only in libm. I used to just invoke gcc > -- since the docs specify that it shouldn't matter, that gcc will see a > .C or .cc file and start looking for C++. Until... The problem is that libstdc++ shared libraries depend on libm. > 2) I no longer have my little test bed program which would demonstrate > this, but I finally got fed up one day with gcc giving me braindead > errors on two pieces of reasonable C++ code. So I bit my tongue and > tried calling it as g++ instead. The first piece of code turned out to > be just fine -- it was simply a part of C that had been changed in the > C++ specifications, and the compiler was still treating it like illegal > C. You sure that file didn't have a .c extension? I've never heard of any problems with recognising extensions before. > I kept that .cc file for a long time, just to be able to demonstrate > that the testing of file extensions is broken in gcc 2.6.x and later, > and that to insure "C++ mode" one must call it as g++ -- which means > putting up with all of the moronic conflicts in the math library. One > /used/ to be able to simply use "gcc -x c++ -x none" along with any > other needed options -- much like the script would do -- and achieve a > perfect compilation. It still does this in 2.7.2, and now the docs > begin to imply that to get a perfect, really-C++-I-mean-it compilation, > one must use g++ because the binary image and only the binary image can > get the options correct. Nope, nope, nope. I usually use 'gcc'. Jason