]> git.ipfire.org Git - thirdparty/xz.git/commit
xz: signals: suppress -Wsign-conversion on macOS
authorSam James <sam@gentoo.org>
Thu, 11 Apr 2024 18:34:04 +0000 (19:34 +0100)
committerLasse Collin <lasse.collin@tukaani.org>
Sun, 14 Apr 2024 14:26:43 +0000 (17:26 +0300)
commit863f13d2828b99b0539ce73f9cf85bde32358034
tree5b543b9467df919a3bb76f0a2ac850f28eacf049
parentfcbd0d199933a69713cb293cbd7409a757d854cd
xz: signals: suppress -Wsign-conversion on macOS

On macOS, we get:
```
signals.c: In function 'signals_init':
signals.c:76:17: error: conversion to 'sigset_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
   76 |                 sigaddset(&hooked_signals, sigs[i]);
      |                 ^~~~~~~~~
signals.c:81:17: error: conversion to 'sigset_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
   81 |                 sigaddset(&hooked_signals, message_progress_sigs[i]);
      |                 ^~~~~~~~~
signals.c:86:9: error: conversion to 'sigset_t' {aka 'unsigned int'} from 'int' may change the sign of the result [-Werror=sign-conversion]
   86 |         sigaddset(&hooked_signals, SIGTSTP);
      |         ^~~~~~~~~
```

We use `int` for `hooked_signals` but we can't just cast to whatever
`sigset_t` is because `sigset_t` is an opaque type. It's an unsigned int
on macOS. On macOS, `sigaddset` is implemented as a macro.

Just suppress -Wsign-conversion for `signals_init` for macOS given
there's no real nice way of fixing this.
src/xz/signals.c