[MPlayer-dev-eng] Question about configure and signal.h

Giorgio mywing81 at gmail.com
Wed Jul 14 14:46:17 CEST 2010


Hello,

on my Linux system I get several warnings like this in config.log:

##########################################

============ Checking for kernel support of mmx ============

#include <stdlib.h>
#include <signal.h>
void catch(void) { exit(1); }
int main(void) {
  signal(SIGILL, catch);
  __asm__ volatile ("emms":::"memory"); return 0;
}

cc /tmp/mplayer-configure--6459/tmp.c  -I.      -o
/tmp/mplayer-configure--6459/tmp
/tmp/mplayer-configure--6459/tmp.c: In function 'main':
/tmp/mplayer-configure--6459/tmp.c:5: warning: passing argument 2 of
'signal' from incompatible pointer type


Result is: yes
##########################################

This is because the signal handler function catch() should take one
integer argument specifying the signal number, and have return type
void. The following patch fixes this:

Index: configure
===================================================================
--- configure	(revision 31734)
+++ configure	(working copy)
@@ -1761,7 +1761,7 @@
       cat > $TMPC <<EOF
 #include <stdlib.h>
 #include <signal.h>
-void catch(void) { exit(1); }
+void catch(int sig) { exit(1); }
 int main(void) {
   signal(SIGILL, catch);
   __asm__ volatile ("$3":::"memory"); return 0;
@@ -5171,7 +5171,7 @@
   cat > $TMPC << EOF
 #include <signal.h>
 #include <gif_lib.h>
-void catch(void) { exit(1); }
+void catch(int sig) { exit(1); }
 int main(void) {
   signal(SIGSEGV, catch);  // catch segfault
   printf("EGifPutExtensionFirst is at address %p\n", EGifPutExtensionFirst);


Would this break something on other systems/OSes?

Regards,

Giorgio Vazzana


More information about the MPlayer-dev-eng mailing list