Re: Anatomy of a sigset_t

Mike Black (mblack@csihq.com)
Wed, 10 Dec 1997 07:09:57 -0500


You need to see the difference here:

Using libc-5.3.38:

gcc -E test.c | sed -ne '/^.*[^ \t].*$/p' > test.out
Produces:
# 1 "test.c" 2
void main() {
sigset_t s;
sigemptyset(&s);
sigaddset(&s, 10 );
sigprocmask(0 , &s, ((void *) 0) );
}

Whereas:
gcc -O -E test.c | sed -ne '/^.*[^ \t].*$/p' > test.out
Produces:
# 1 "test.c" 2
void main() {
sigset_t s;
((*( &s ) = 0L), 0) ;
sigaddset(&s, 10 );
sigprocmask(0 , &s, ((void *) 0) );
}

I don't think that "((*( &s ) = 0L), 0) ;" is going to work very well with
an array!!
This is due to the __OPTIMIZE__ section in /usr/include/signal.h

My solution was simply to get rid of the __OPTIMIZE__ section.