Bug 261826

Summary: emulators/joytran: Fails to build: error: variable 'delay' set but not used [-Werror,-Wunused-but-set-variable]
Product: Ports & Packages Reporter: Timothy Beyer <beyert>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Some People CC: beyert, mikael
Priority: --- Keywords: needs-patch, needs-qa
Version: LatestFlags: beyert: maintainer-feedback+
koobs: merge-quarterly?
Hardware: Any   
OS: Any   
Attachments:
Description Flags
fix variable set but not used warning / error
none
[PATCH] turn off -Werror and fix variable set but not used warning
none
emulators_joytran working in poudriere
none
emulators_joytran working in poudriere beyert: maintainer-approval+

Description Timothy Beyer 2022-02-09 13:02:05 UTC
Created attachment 231675 [details]
fix variable set but not used warning / error

Fixes build error for emulators/joytran on modern compilers by not initializing variable delay to 0 when the initialized value will never be used.

The error is as follows:
*  error: variable 'delay' set but not used [-Werror,-Wunused-but-set-variable]
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2022-02-26 00:08:14 UTC
Thank you for the report and patch Timothy. As a rule of thumb and defacto recommendation, ports should not build with -Werror. Can you provide a patch that either disables this via build configuration or overrides it with -Wno-error.

If you can submit warning fixes upstream too, that would be great

Thanks!
Comment 2 Timothy Beyer 2022-02-26 04:37:44 UTC
(In reply to Kubilay Kocak from comment #1)
Thanks, I've been meaning to do a new release of joytran for a while, I just haven't gotten around to do doing so.

For now, I can make a new patch that also disables -Werror.  I was much less experienced at writing build systems when I first wrote joytran, but it seems that -Werror was a bad idea.
Comment 3 Timothy Beyer 2022-02-28 09:48:35 UTC
Created attachment 232156 [details]
[PATCH] turn off -Werror and fix variable set but not used warning

Updated patch to also turn off -Werror
Comment 4 Rene Ladan freebsd_committer freebsd_triage 2022-03-07 19:55:09 UTC
Maintainer reset.
Comment 5 Timothy Beyer 2022-05-17 04:03:36 UTC
Created attachment 233979 [details]
emulators_joytran working in poudriere

Confirmed building in poudriere on multiple versions of FreeBSD, almost identical to last version except bump PORTREVISION and this patch was tested more recently.

I am the maintainer of both the project itself and the port, can someone commit this patch?
Comment 6 Timothy Beyer 2022-05-17 04:46:10 UTC
Created attachment 233984 [details]
emulators_joytran working in poudriere

fix subject in patch, but otherwise identical