bugtexinfo - GNU documentation system - Bugs: bug #8461, use Standard C signal handling

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8461: use Standard C signal handling

Submitted by:  Karl Berry <karl>
Submitted on:  Mon 05 Apr 2004 09:33:44 PM UTC  
 
Category: infoRelease: 
Priority: 5 - NormalSeverity: 1 - Wish
Item Group: bugPrivacy: Public
Open/Closed: ClosedAssigned to: None
Status: None

Mon 07 Feb 2011 05:31:23 PM UTC, comment #1:

Guessing that signal handling in info/signals.c is better since 2004.

Karl Berry <karl>
Project Administrator
Mon 05 Apr 2004 09:33:44 PM UTC, original submission:

as reported by Nelson Beebe, current code in info/signals.c does not compile with c89 compilers, for instance:
Machinetype: Sun Ultra 2/2400 (400 MHz); Solaris 2.9
CC=/opt/studio9/SUNWspro/bin/c89
cc: Sun C 5.6 EA1 2003/12/17

The error is:
/opt/studio9/SUNWspro/bin/c89 -DHAVE_CONFIG_H -DLOCALEDIR=\"/usr/local/share/lo\
cale\" -DINFODIR=\"/usr/local/info\" -DINFODIR2=\"/usr/local/share/info\" -I. -\
I. -I.. -I. -I../lib -I../intl -I.. -I. -I/usr/local/include -I/usr/local/inc\
lude -c signals.c
"signals.c", line 116: incomplete struct/union/enum sigaction: old_QUIT

Nelson writes:
I looked at the preprocessor output and system header files, and found
the problem: old_QUIT is declared as

static signal_info old_QUIT;

and signal_info is declared as

typedef struct sigaction signal_info;

However, in a C89 environment, struct sigaction is not exposed in
<sys/signal.h>. It needs either a nonstandard C environment (cc), or
a POSIX, X/OPEN, or XPG environment, because of this wrapper:

#if defined(_EXTENSIONS_) || ((_STDC_ - 0 == 0) && \
!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || \
(_POSIX_C_SOURCE > 2) || defined(_XPG4_2)
/*
...
#endif

These successfully compile signal.o:

make signals.o CFLAGS='-I/usr/local/include -D_POSIX_SOURCE'
make signals.o CFLAGS='-I/usr/local/include -D_POSIX_C_SOURCE'
make signals.o CFLAGS='-I/usr/local/include -D_XOPEN_SOURCE'
make signals.o CFLAGS='-I/usr/local/include -D_XPG4_2'

Presumably the info program needs signal handling to trap Ctl-C so
that it can restore terminal modes. The question is, can this be done
entirely with the Standard C signalling mechanism, or does it really
need Unix/POSIX/XPG4/XOPEN extensions? If not, it would be better to
make the code strictly Standard-C conformant, since it would then
compile in the maximum number of environments.

Karl Berry <karl>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by karl (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Feb 2011 05:31:23 PM UTCkarlOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1