Skip to content

Conversation

@tk154
Copy link
Contributor

@tk154 tk154 commented Jan 7, 2026

📦 Package Details

Maintainer: @nikil

Description:
ifstat fails to build with GCC 15 due to an incorrect detection of the signal handler return type.
The configure script shipped with ifstat uses an obsolete K&R-style declaration: void (*signal())();

With GCC 15 this causes the signal() return type check to incorrectly assume int instead of void.
As a result, the generated code defines signal handlers returning int, which conflicts with struct sigaction expecting a void (*)(int) handler and leads to a build failure:

ifstat.c: In function '_setsig':                                                                                                                                                                                    
ifstat.c:75:17: error: assignment to 'void (*)(int)' from incompatible pointer type 'int (*)(int)' [-Wincompatible-pointer-types]                                                                                   
   75 |   sa.sa_handler = handler;                                                                                                                                                                                  
      |                 ^

Enable autoreconf during the build to regenerate the configure script, which correctly detects the signal handler type and fixes the compilation error.


🧪 Run Testing Details

  • OpenWrt Version: Snapshot
  • OpenWrt Target/Subtarget: x86/64
  • OpenWrt Device: Generic x86/64

✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

ifstat fails to build with GCC 15 due to an incorrect detection of the
signal handler return type.

The configure script shipped with ifstat uses an obsolete K&R-style
declaration:

  void (*signal())();

With GCC 15 this causes the signal() return type check to incorrectly
assume 'int' instead of 'void'. As a result, the generated code defines
signal handlers returning int, which conflicts with struct sigaction
expecting a void (*)(int) handler and leads to a build failure:

  assignment to 'void (*)(int)' from incompatible pointer type
  'int (*)(int)'

Enable autoreconf during the build to regenerate the configure
script, which correctly detects the signal handler type and fixes
the compilation error.

Signed-off-by: Til Kaiser <mail@tk154.de>
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING

PKG_FIXUP:=autoreconf
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neheb is here autoreconf guru for removing and adding it back. 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants