Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

318
Vistas
What does ((void (*)(int))-1) mean?

I just found this.

// /usr/include/sys/signal.h // OS X
#define SIG_ERR ((void (*)(int))-1)

What does ((void (*)(int))-1) part mean?

Is it different to

#define SIG_ERR -1

?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

This is cast to a function-pointer:

((type) value)

Where type is void (*)(int) which is pointer to function accepting one int argument and returning void, which is actually is a signature of a signal handler:

typedef void (*sighandler_t)(int);

You may decode such types with cdecl tool or web-site: http://cdecl.org/

over 4 years ago · Santiago Trujillo Denunciar

0

This is a cast of -1 into the function pointer which is expected as the type of SIG_ERR. Using -1 directly does not work at situations where the compiler needs the correct type.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda