Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

324
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!