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 30 12:03

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)
Re: [vox-tech] compiler error causing me great sadness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] compiler error causing me great sadness

--On Wednesday, September 29, 2004 11:06:50 PM -0400 Peter Jay Salzman <p@dirac.org> wrote:

   #ifndef _FSIGNAL_H_
   #define _FSIGNAL_H_

   #define __GNU_SOURCE
   #include <signal.h>
   #include <stdio.h>
I think you want _GNU_SOURCE there, not __GNU_SOURCE. Though "#define _POSIX_C_SOURCE 199309L" should be adequate.

It's kind of a mess, but when I include __USE_POSIX and
__USE_POSIX199309, I get "constant redefinition" errors.  So instead, I
You aren't supposed to define the __USE_* macros yourself. See <features.h>. Actually, when I ran your fsignal.h through "gcc -E" the postprocessed C contained the siginfo_t definition. If you're not getting it, then perhaps you've set one of the standard-selection macros to an old standard such that __USE_POSIX199309 isn't supposed to be defined.

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???
No, of course not. There are standards for this stuff, though programming books don't always do a good job of explaining them. For example, on a modern system running:

echo '#include <signal.h>' | gcc -E -

should get you a copy of the siginfo_t definition, but:

echo '#include <signal.h>' | gcc -E -D_POSIX_SOURCE -

because _POSIX_SOURCE implies a specific revision of the POSIX standard that predates the siginfo_t type.

Ken Herron
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:
Appahost Applications
For a significant contribution towards our projector, and a generous donation to allow us to continue meeting at the Davis Library.