[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
silence type complaints about signal vs. atexit handlers
From: |
Martin Neitzel |
Subject: |
silence type complaints about signal vs. atexit handlers |
Date: |
Fri, 1 Oct 2004 20:07:20 +0200 (CEST) |
>Submitter-Id: net
>Originator: Martin Neitzel
>Organization: Gaertner Datensysteme
>Confidential: no
>Synopsis: silence type complaints about signal vs. atexit handlers
>Severity: non-critical
>Priority: low
>Category: cvs
>Class: sw-bug
>Release: 1.12.9.1
>Environment:
System: IRIX sco 5.3 11091810 IP12 mips
(Probably any ANSI C build environment.)
>Description:
Compiler warnings in src/exithandle.c.
There is a certain "dual use" of functions as both
signal handlers and cleanup functions which inflict
a function type dilemma.
>How-To-Repeat:
Compile with warnings taken seriously.
>Fix:
Well, I usually hate casts like the plague but this patch here has
minimal impact on the overall setup and will resolve the trilemma to
get signals_register() cleanup_register(), and atexit() und a hood.
It's a dirty job but someone's got to do it.
Index: src/exithandle.c
===================================================================
RCS file: /cvs/ccvs/src/exithandle.c,v
retrieving revision 1.1
diff -u -r1.1 exithandle.c
--- src/exithandle.c 5 Oct 2003 03:32:45 -0000 1.1
+++ src/exithandle.c 1 Oct 2004 14:06:48 -0000
@@ -44,6 +44,6 @@
void
cleanup_register (void (*handler) (void))
{
- signals_register (handler);
+ signals_register ((RETSIGTYPE (*)(int)) handler);
atexit (handler);
}
- silence type complaints about signal vs. atexit handlers,
Martin Neitzel <=