Hi,
I've come across something that I find very odd and I haven't been able to
find any previous questions about it anywhere. I hope it's not a silly question
with an obvious answer.
I've narrowed the problem down to a very simple one.
If I compile the following program with gcc (as a C program) it works
fine.
#include<unistd.h>
int main()
{
return getpgid(0);
But when I compile it with g++ as a C++ program I get this message:Quote:}
test.cc: In function `int main()':
test.cc:6: implicit declaration of function `int getpgid(...)'
If I do a forward declaration of the getpgid fcn I will get a link error:
/tmp/ccHofd4c.o: In function `main':
/tmp/ccHofd4c.o(.text+0xc): undefined reference to `getpgid(int)'
collect2: ld returned 1 exit status
At least this is the behaviour on Linux distros mandrake 6.1 and 7.0
and debian potato (i think). This is with version 2.95.2.
On a VAX (Ultrix 4.4) with 2.8.1 I get both link error and warning in
c++ and only the link error in c.
On a Sun UltraSparc with SunOS 5.7 (Solaris v??) and gcc 2.95.1 everything
works just fine.
Is this a real bug or am I missing something?
Thanks in advance
Lars
--