Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

quassel-irssi fails to build with gcc 8 due to -Werror=cast-function-type #29

Open
TC01 opened this issue Feb 13, 2018 · 2 comments
Open

Comments

@TC01
Copy link
Contributor

TC01 commented Feb 13, 2018

quassel-irssi's build failed in the Fedora 28 mass rebuild, which was done using gcc 8 and irssi 1.0.6. This seems to be due to setting the build flag-Werror=cast-function-type, e.g.:

quassel-net.c:110:8: error: cast between incompatible function types from 'void (*)(Quassel_SERVER_REC *)' {aka 'void (*)(struct Quassel_SERVER_REC_s *)'} to 'void (*)(void *, GIOChannel *, int)' {aka 'void (*)(void *, struct _GIOChannel *, int)'} [-Werror=cast-function-type]
        (GInputFunction) quassel_parse_incoming, r);
        ^
In file included from /usr/include/irssi//src/core/commands.h:4,
                 from quassel-net.c:25:
quassel-net.c: In function 'quassel_net_init':
quassel-net.c:165:39: error: cast between incompatible function types from 'void (*)(Quassel_SERVER_REC *)' {aka 'void (*)(struct Quassel_SERVER_REC_s *)'} to 'void (*)(const void *, const void *, const void *, const void *, const void *, const void *)' [-Werror=cast-function-type]
  signal_add_first("server connected", (SIGNAL_FUNC) sig_connected);
                                       ^
/usr/include/irssi//src/core/signals.h:23:78: note: in definition of macro 'signal_add_first'
  signal_add_full(MODULE_NAME, SIGNAL_PRIORITY_HIGH, (signal), (SIGNAL_FUNC) (func), NULL)
                                                                              ^~~~

There are a bunch more of these sorts of errors in the build log.

@TC01
Copy link
Contributor Author

TC01 commented Feb 20, 2018

Just an update: the build can indeed be fixed by passing -Wno-cast-function-type, but I don't know if this is a particularly sane thing to do. Unlike #25 this seems like something that might be an actual issue.

@TC01
Copy link
Contributor Author

TC01 commented Mar 15, 2018

After some investigation I think the cast function type warning is firing because SIGNAL_FUNC accepts up to six arguments but the calls here are only passing a handful, which makes me think that turning off the warning is the right thing to do. Just to be safe, I fired up a Fedora 28 chroot and tested this in there; it seems that quassel-irssi still functions.

I am a bit surprised that this warning hasn't (as far as I can tell) affected the build of irssi itself.

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

No branches or pull requests

1 participant