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

Fix GCC compiler error #2656

Conversation

dmikushin
Copy link

Fixing the following compiler error on gcc (GCC) 8.5.0 20210514 (RedHat 8.5.0-18):

/root/rpm/plugins/dbus_announce.c:69:5: error: a label can only be part of a statement and a declaration is not a statement
     int ignore = dbus_error_has_name(&err, DBUS_ERROR_NO_SERVER) ||
     ^~~

…Hat 8.5.0-18):

/root/rpm/plugins/dbus_announce.c:69:5: error: a label can only be part of a statement and a declaration is not a statement
     int ignore = dbus_error_has_name(&err, DBUS_ERROR_NO_SERVER) ||
     ^~~
@pmatilai
Copy link
Member

Oh, this "wonderful" quirk of C99. I wonder why newer gcc doesn't complain because I don't think it's legit in C11 either.

Fixed a little differently in 34d983f because I hate the way those locally added blocks mess up the git history (or blame rather), and for full disclosure in the commit log: it's a regression introduced in 071be75.

Thanks for the patch!

@pmatilai pmatilai closed this Sep 13, 2023
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.

None yet

2 participants