l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
Page last updated:
2004 Sep 29 23:53

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
[vox-tech] compiler error causing me great sadness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vox-tech] compiler error causing me great sadness

This is causing me great pain...

This is the compiler error:

p@satan$ make
colorgcc -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return
-Wpointer-arith -Wcast-qual -Wcast-align -Wmissing-declarations
-Wnested-externs -Wredundant-decls -Wwrite-strings -Winline -Werror -std=c99
-g3   -c -o avataralt.o avataralt.c
In file included from avataralt.c:5:
fsignal.h:15: error: parse error before "siginfo_t"
fsignal.h:15: warning: function declaration isn't a prototype
fsignal.h:16: error: parse error before "siginfo_t"
fsignal.h:16: warning: function declaration isn't a prototype
make: *** [avataralt.o] Error 1

The header file causing me grief is:

   #ifndef _FSIGNAL_H_
   #define _FSIGNAL_H_

   #define __GNU_SOURCE
   #include <signal.h>
   #include <stdio.h>

   /* Enable FPE's, by default all FPE's will not raise a signal when 
    * they happen... see fenv.h for magic constants. */
   void fpe_trap_enable(void);
   void Initialize_Signals(void);
   void fpe_print_cause(FILE *file, siginfo_t *info);
   void fpe_callback(int sig_number, siginfo_t *info, void *data);
   void int_callback(int sig_number);


The definition for siginfo_t isn't being pulled in, even though it SHOULD be
in signal.h.   But why is gcc telling me:

   warning: function declaration isn't a prototype

What's that supposed to mean?  Why isn't the declaration a prototype?  That's
just bizarre!  It sure looks like a prototype!  My implicit assumption is
that the warning is related to the error.  Maybe they're unrelated.  I dunno.

Looking through signal.h, I see:

   # ifdef __USE_POSIX199309
   /* We need `struct timespec' later on.  */
   #  define __need_timespec
   #  include <time.h>

   /* Get the `siginfo_t' type plus the needed symbols.  */
   #  include <bits/siginfo.h>
   # endif

It's kind of a mess, but when I include __USE_POSIX and __USE_POSIX199309, I
get "constant redefinition" errors.  So instead, I add:

   #include <bits/siginfo.h>

to my header file, and voila, the program compiles.

OK, I figured this out with a cockamamy fix.  Now I want to know how I'm
_really_ supposed to make this compile.

How am I supposed to figure out how to get a definition for siginfo_t?  Am I
really supposed to grub around in the libc header files???


Make everything as simple as possible, but no simpler. -- Albert Einstein
GPG Instructions: http://www.dirac.org/linux/gpg
GPG Fingerprint: B9F1 6CF3 47C4 7CD8 D33E 70A9 A3B9 1945 67EA 951D
vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
Sunset Systems
Who graciously hosts our website & mailing lists!