03 Dec, 2008, Lobotomy wrote in the 1st comment:
Votes: 0
I'm going to need a little help on this one, as I'm coming across errors on my new host I hadn't had to deal with previously and all of my Google searches are turning up very little information. It's important that I find out whether it's a problem with the version of GCC installed in the server, a problem with my code, or both. The reason I suspect my own code as being partly to blame is a result of my heavy use of the C99 additions to C. Currently, version 4.2.3 of gcc is installed on the host, and there are three specific errors that I'm receiving in copius amounts from nearly every standard header I have included into my source:

In file included from (etc):
/usr/include/features.h:265:5: warning: "_FORTIFY_SOURCE" is not defined
In file included from (etc):
/usr/include/sys/sysmacros.h:43: warning: C99 inline functions are not supported; using GNU89
/usr/include/sys/sysmacros.h:43: warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
In file included from (etc):
/usr/include/stdio.h:830:5: warning: "__USE_FORTIFY_LEVEL" is not defined

…and it goes on and on. Anyhow, the extent of what little I've been able to beat mercilessly out of Google seems to be that this is some sort of error or othersuch introduced with version 4.1 or 4.2 of gcc that has been dealt with as of 4.3. However, I can't seem to get a concrete answer on that particular bit, or anything else (i.e, if there's something new to how C99 is handled I haven't been told of - maybe new compiler options I need to set, or something else), so any help would be greatly appreciated.
03 Dec, 2008, ghasatta wrote in the 2nd comment:
Votes: 0
What you posted is a warning, not an error. If the compile is failing, there is something else going on.

As far as that warning goes, from what I gather, in gcc 4.2 the handling of inline functions hasn't changed, but the warning message has been added ahead of planned support for C99 inlining in gcc 4.3. So, you can use -fgnu89-inline option in your compile command explicitly to disable the warning (it won't mean any different behavior until gcc 4.3).

So, you should be ok.
03 Dec, 2008, Lobotomy wrote in the 3rd comment:
Votes: 0
ghasatta said:
What you posted is a warning, not an error.

Semantics! :tongue:

Anyhow, the point is that I want the messages to go away; having to sift through a couple hundred or more lines of superflous warning messages to find one or two actual errors is going to get old rather quickly. I'm aware of the -fgnu89-inline option for the one strain of warning messages, however the other two I haven't found any sort of information on how I would go about resolving or otherwise silencing them.
03 Dec, 2008, David Haley wrote in the 4th comment:
Votes: 0
You could try compiling with a different version of gcc. Try typing "gcc<TAB>" (where <TAB> is a literal tab character) and seeing what auto-completions you get. Then change your makefile to use one of the other versions. E.g. on one of my servers, I have: gcc gcc-3.3 gcc-4.1 gcc-4.2
03 Dec, 2008, Zeno wrote in the 5th comment:
Votes: 0
lol. :P
In regards to using other gcc versions: http://zeno.biyg.org/index.php?a=topic&a...
03 Dec, 2008, Lobotomy wrote in the 6th comment:
Votes: 0
Yeah, I was about to make a reference to that myself, and personally I'd rather not cause potential instability for everyone else on the server just to suit my own needs. Although, I'm curious if it's possible to install gcc 4.3 without having it become the default version used by the regular gcc command.
03 Dec, 2008, David Haley wrote in the 7th comment:
Votes: 0
Yes, most Linux distros have a "select-alternative" type of program that lets you choose which version of a program should be used by default.
03 Dec, 2008, tphegley wrote in the 8th comment:
Votes: 0
So how do I select the old g++ I used? My mud won't compile now.
03 Dec, 2008, Zeno wrote in the 9th comment:
Votes: 0
The old gcc is still there; do what David said (the tab thing) to see the exec name. You can use that, or try using gcc -V (never tried it though).

Although I do recommend fixing any errors instead of ignoring them.
03 Dec, 2008, tphegley wrote in the 10th comment:
Votes: 0
So in the Makefile I have CC g++. I'm using smaugfuss1.8

When I g++<tab> I get:

g++ g++-gcc-4.2.3

I get the warnings/errors either way I put the CC in the Makefile.
I know eventually I'll go through and change the errors, but for right now I'd just like to get it to compile again.
03 Dec, 2008, David Haley wrote in the 11th comment:
Votes: 0
That's strange. What if you type just: g++-4.1 -v
03 Dec, 2008, tphegley wrote in the 12th comment:
Votes: 0
make -s smaug
Compiling o/imc.o….
make[1]: g++-4.1: Command not found
make[1]: *** [o/imc.o] Error 127
make: *** [all] Error 2

That's what I get when I put g++-4.1 -v in my Makefile
03 Dec, 2008, David Haley wrote in the 13th comment:
Votes: 0
Zeno, are you sure that you have several versions of gcc installed?

tphegley, did you try g++ -V?
03 Dec, 2008, tphegley wrote in the 14th comment:
Votes: 0
Still not compiling

Here's my output when I did g++ -v

make -s smaug
Compiling o/imc.o….
Reading specs from /usr/lib/gcc/i486-slackware-linux/4.2.3/specs
Target: i486-slackware-linux
Configured with: ../gcc-4.2.3/configure –prefix=/usr –enable-shared –enable-languages=ada,c,c++,fortran,java,objc
–enable-threads=posix –enable-__cxa_atexit –disable-checking –with-gnu-ld –verbose –with-arch=i486
–target=i486-slackware-linux –host=i486-slackware-linux
Thread model: posix
gcc version 4.2.3
/usr/libexec/gcc/i486-slackware-linux/4.2.3/cc1plus -quiet -v -D_GNU_SOURCE -DIMC -DIMCSMAUG imc.c -quiet -dumpbase imc.c
-mtune=i486 -march=i486 -auxbase-strip o/imc.o -g2 -Wall -Werror -Wshadow -Wformat-security -Wpointer-arith -Wcast-align
-Wredundant-decls -Wconversion -version -o /tmp/ccaZ3Cxg.s
ignoring nonexistent directory "/usr/lib/gcc/i486-slackware-linux/4.2.3/../../../../i486-slackware-linux/include"
#include "…" search starts here:
#include <…> search starts here:
End of search list.
GNU C++ version 4.2.3 (i486-slackware-linux)
compiled by GNU C version 4.2.3.
GGC heuristics: –param ggc-min-expand=90 –param ggc-min-heapsize=113062
Compiler executable checksum: 6e821a92395a6d11d0fecef5a903c36b
cc1plus: warnings being treated as errors
03 Dec, 2008, David Haley wrote in the 15th comment:
Votes: 0
No, we meant just from the command line (not the makefile): type g++ -V
(note capital v)
03 Dec, 2008, Zeno wrote in the 16th comment:
Votes: 0
root@zeno:~# gcc-3.3.6 -v
Using built-in specs.
Configured with: ../gcc-3.3.6/configure –prefix=/usr –enable-shared –enable-threads=posix –enable-__cxa_atexit –disable-checking –with-gnu-ld –verbose –target=i486-slackware-linux –host=i486-slackware-linux
Thread model: posix
gcc version 3.3.6

Not sure where the g++ exec went, will look for it.
03 Dec, 2008, quixadhal wrote in the 17th comment:
Votes: 0
Actually, depending on your distro… it might NOT be there anymore. :surprised:

Debian's testing distro recently depreciated g++ 3.x, and thus if you're doing the standard apt-get dist-upgrade, it may well have removed it entirely. Adding it back is possible, but requires some slight-of-hand with apt-get to enforce that YES you want to install this particular version of gcc/g++ and YES you know it's not the most recent available.

This is the point in the professional software development model where you go to the boss and tell them that either they allocate the resources needed to update FOOWARE to current standards, or they have to freeze the equipment it's running on and stop applying updates, as they will break it. That's also the point to go into your schpeal about how big of a security risk it is if you can't update things, and how new development won't be able to co-exist on the same servers with legacy apps.
03 Dec, 2008, Zeno wrote in the 18th comment:
Votes: 0
I don't even think apt-get works on Slackware, does it?
03 Dec, 2008, Zeno wrote in the 19th comment:
Votes: 0
Old version of g++ is now available.
04 Dec, 2008, tphegley wrote in the 20th comment:
Votes: 0
so what do I put in my makefile then? Or how do I use the old version?