Strange Compiler Error

Strange Compiler Error

Post by Kurt Wal » Thu, 09 Sep 1999 04:00:00



Hi all,

I've a program using the kill function, which, according to my man page, is
prototyped in <signal.h> and also needs <sys/types.h>.  So, I include these
headers in my program.  Compiling as follows, the preprocessor complains:

$ gcc -g -Wall -ansi -pedantic-errors    killer.c   -o killer
killer.c: In function `main':
killer.c:27: warning: implicit declaration of function `kill'

My gcc is
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

I'm kinda confused.  Thanks for any hints.

Kurt
--
A diplomat is man who always remembers a woman's birthday but never her age.
                -- Robert Frost

 
 
 

Strange Compiler Error

Post by Jeff Rav » Thu, 09 Sep 1999 04:00:00



Quote:>Hi all,

>I've a program using the kill function, which, according to my man page, is
>prototyped in <signal.h> and also needs <sys/types.h>.  So, I include these
>headers in my program.  Compiling as follows, the preprocessor complains:

>$ gcc -g -Wall -ansi -pedantic-errors    killer.c   -o killer
>killer.c: In function `main':
>killer.c:27: warning: implicit declaration of function `kill'

>My gcc is
>$ gcc -v
>Reading specs from /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/specs
>gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

>I'm kinda confused.  Thanks for any hints.

>Kurt

Hmm. Taking a peek at the signal.h header, it looks like
you might want to add a -D__USE_POSIX to your call to gcc.
That should get you the prototype you want.

Hope that helps,
Jeff Raven

 
 
 

Strange Compiler Error

Post by Marcus Sundbe » Thu, 09 Sep 1999 04:00:00




Quote:> Hi all,

> I've a program using the kill function, which, according to my man page, is
> prototyped in <signal.h> and also needs <sys/types.h>.  So, I include these
> headers in my program.  Compiling as follows, the preprocessor complains:

> $ gcc -g -Wall -ansi -pedantic-errors    killer.c   -o killer
> killer.c: In function `main':
> killer.c:27: warning: implicit declaration of function `kill'

> My gcc is
> $ gcc -v
> Reading specs from /usr/lib/gcc-lib/i386-linux/egcs-2.91.66/specs
> gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)

> I'm kinda confused.  Thanks for any hints.

kill() is not an ANSI C function, and you just told gcc that you
want ANSI C.

//Marcus
--
-------------------------------+------------------------------------
        Marcus Sundberg        | http://www.stacken.kth.se/~mackan
 Royal Institute of Technology |       Phone: +46 707 295404

 
 
 

1. strange compiler errors after MU1

hi;

Since i applied MU1 to my (stock) x86 Solaris 2.7 System i have a
strange effect on compilations. I get sometimes
parse errors for one time only. Restarting the process and it compiles
with no Problem!? This happends for gcc/egcs (cc)
and more often to g++ (gcc/egcs). I think something in the communication
path between cpp and the backend is broken. Since i got no other strange
effects (segfaults etc.) this is  _no_ Hardware Problem (bad RAM etc).

PS I tested this with 3 compiler instances (gcc 2.8.1 , egcs1.1.1 and
egcs112) - each behaves this way

Any insight,ideas where to look for or which patch to apply ???

Thanks in advance,

hb
---------------------------------------------------------------------
UNIX SysAdmin - BCI GmbH


-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 2.6.3ia

mQCNAzbRbOAAAAEEANjiKN6BDGeQ9C7qtAl4locT2zYPpLxVFTBu6DHWIHqErJ0K
8YJ1LtquO+B3+DztON8CAIW0Q0XuaKUrok7il/JQ0CLzdQYFm09nKwgijeE+IIm/
vRlGjzP1z444gM0CN1ScQLupRbByLdxUXB75HGdX0+qizjlvBgqz9Ot8Cuu9AAUR
tCNIb2xnZXIgQnVyZGUgPGhidXJkZUBiY2ktYnJlbWVuLmRlPokAlQMFEDbRbOAK
s/TrfArrvQEBB38D+QHY+Tu381uBCpBj8awDdngEXF/pfS9kudrzS0LHKtvHHONV
TfcTBynGN6PChVyB3lBrXpQ0mu/35qx34fTG7FkNMQeQn3in3Ofp+sB4pV6THt+d
efJ6xofuVKJtVIVfV82g6K48vb7aFaDVjviTGPT8qskidW94KGD2hMA/dfSL
=i+zT
-----END PGP PUBLIC KEY BLOCK-----

2. PPP & T-Online under RH6.2

3. Strange compiler errors. Need help.

4. BUILD PROBLEM - Linux 2.5 BK - smpboot.c

5. Strange compiler error!!!

6. Can I move part of my filesytem to a new partition ?

7. Strange "undefined reference" compiler errors

8. Flightgear

9. Strange error message, very strange ...

10. Strange Strange SPARQ error

11. Error when rebuilding kernel [Internal compiler error: program as got fatal signal 6] - Help

12. compiling error with ssh: configure: error: installation or configuration problem: C compiler cannot create executables.

13. SAMBA : Internal compiler error: program cc1 got fatal signal 6 [smbpass.o] Error 1