[libc-commits] [libc] [libc][signal] clean up usage of sighandler_t (PR #125745)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Wed Feb 5 15:56:35 PST 2025


================
@@ -69,10 +69,15 @@ functions:
   - name: signal
     standards:
       - stdc
-    return_type: sighandler_t
+    # May the Geneva Convention have mercy on my soul... Why this insanity?
+    # Well: signal returns a function pointer to a function with no return
+    # value and which accepts an int. The parameter list appears on the far
+    # right of the declaration. i.e.
+    # void (*signal(int, void (*)(int)))(int);
+    return_type: void (*
     arguments:
       - type: int
-      - type: sighandler_t
+      - type: void (*)(int)))(int
----------------
nickdesaulniers wrote:

Yes, see the comment. hdrgen just pastes `return_type` + `name` + `(` + arguments + `)`.

https://github.com/llvm/llvm-project/pull/125745


More information about the libc-commits mailing list