buglibsigsegv - Bugs: bug #63788, ...

 
 

bug #63788: -Wincompatible-function-pointer-types warning/error in configure.ac with Clang 16

Submitter:  Sam James <thesamesam>
Submitted:  Sat 11 Feb 2023 05:04:54 AM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  haible
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 11 Feb 2023 05:47:30 PM UTC, comment #5: 

Ah, that makes sense now. Yes, the configure-time code snippet for Mac OS X/Darwin 7 on PowerPC is used also on Linux/x86_64 and contains an incompatible function pointer assignment.

It's fixed now; thanks for the report.

Bruno Haible <haible>
Group administrator
Sat 11 Feb 2023 05:36:07 PM UTC, comment #4: 

(I apologise for not stating that clearly - I put it in the summary, but I didn't explain it properly in the bug, and I filed this last night.)

Sam James <thesamesam>
Sat 11 Feb 2023 05:35:27 PM UTC, comment #3: 

To be clear, the warning is in libsigsegv's configure, and emitted in config.log, not building libsigsegv's actual source.

Sam James <thesamesam>
Sat 11 Feb 2023 05:29:25 PM UTC, comment #2: 

Although there is no problem on Linux/x86_64, there would be a nontrivial function pointer cast after fault-openbsd.h or fault-macosdarwin7-powerpc.h has been included. For the case that clang 16 gets used on one of these platforms, I'm now adding a function pointer cast in that line. IMO it will only matter for OpenBSD, when OpenBSD switches to clang 16 as the default compiler (in 1-2 years maybe).

Bruno Haible <haible>
Group administrator
Sat 11 Feb 2023 05:03:05 PM UTC, comment #1: 

I can't reproduce this.

I built clang 16.0.0 rc2 from source.
When I use it to build libsigsegv-2.14, I get the same CFG_FAULT value as you do (according to your config.log), namely fault-linux-i386.h. This file does not define SIGSEGV_FAULT_HANDLER_ARGLIST, but instead refers to the parent file fault-posix-ucontext.h. This file has


#define SIGSEGV_FAULT_HANDLER_ARGLIST  int sig, siginfo_t *sip, void *ucp


This definition get stuffed into handler-unix.c line 134. So, at handler-unix.c line 385 there are no incompatible types - it's the same function type on the right-hand side as on the left-hand side.

In the error message that you showed, you have a function type with ucontext_t (instead of void ) in the third argument. There's only one fault-*.h file that provides this signature in all of libsigsegv, namely fault-macosdarwin7-powerpc.h — which obviously doesn't apply.

So, I conclude that you must be using neither libsigsegv-2.14, nor libsigsegv-2.14 with the modifications from https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libsigsegv, nor libsigsegv git master, but something else. Did you make some source modifications yourself?

Bruno Haible <haible>
Group administrator
Sat 11 Feb 2023 05:04:54 AM UTC, original submission:  

Clang 16 will make -Wincompatible-function-pointer-types (and some other warnings) an error by default.

Catching these is tricky so I currently diff the compiler warning/error output before/after using relaxed vs strict options. For libsigsegv-2.14, this yields:
```
-ignoreme: warning: incompatible function pointer types assigning to 'void ()(int, siginfo_t , void )' from 'void ()(int, siginfo_t , ucontext_t )' (aka 'void ()(int, siginfo_t , struct ucontext_t *)') [-Wincompatible-function-pointer-types]
+ignoreme: error: incompatible function pointer types assigning to 'void ()(int, siginfo_t , void )' from 'void ()(int, siginfo_t , ucontext_t )' (aka 'void ()(int, siginfo_t , struct ucontext_t *)') [-Werror,-Wincompatible-function-pointer-types]
 action.sa_sigaction = &sigsegv_handler;
                     ^ ~~~~~~~~~~~~~~~~
```

I've attached the full config.log. This occurred on x86_64-pc-linux-gnu with Clang 16.0.0_rc2. Let me know if more information is required, thanks!

Sam James <thesamesam>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54346:  config.log added by thesamesam (154KiB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by haible (Posted a comment)
  • -email is unavailable- added by thesamesam (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-02-11 haible StatusWorks For Me Fixed
    2023-02-11 haible StatusNone Works For Me
        Assigned toNone haible
        Open/ClosedOpen Closed
    2023-02-11 thesamesam Attached File- Added config.log, #54346

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code