Bug 199737 - [patch] comms/linrad : fix two bugs (fatal on gcc5)
Summary: [patch] comms/linrad : fix two bugs (fatal on gcc5)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Stephen Hurd
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2015-04-27 17:46 UTC by John Marino
Modified: 2015-05-01 16:26 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (hamradio)


Attachments
Fix linrad on latest gcc (1.88 KB, patch)
2015-04-27 17:46 UTC, John Marino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Marino freebsd_committer freebsd_triage 2015-04-27 17:46:48 UTC
Created attachment 156048 [details]
Fix linrad on latest gcc

I checked linrad upstream, and they still haven't fixed these two bugs.  I am surprised they haven't been reported yet.  Without these fixes, linrad cannot be built with gcc5.

the menu.c patch simply reverses the order of the condition.  One must check the bounds constraint first!  It's a pretty dumb mistake but I've seen this kind before.

The second one fails because -Werror is set.  This took me a while because I couldn't figure out the relationship between ADCHANS and rxchan.  In any case, setting 4 locations per channel did indeed allow the array to be big enough.  (at first I thought the loop was running too high, but I finally determined the array was too small).

These were found on DragonFly that uses gcc5. 

This patch has not been tested on FreeBSD but I can't how it could possibly fail.

It would be good if the ham@ maintainer reports the issue upstream.
Comment 1 Stephen Hurd freebsd_committer freebsd_triage 2015-04-28 08:10:02 UTC
I'll take this, but we haven't had much luck pushing patches upstream with this port.
Comment 2 John Marino freebsd_committer freebsd_triage 2015-04-28 08:44:17 UTC
Thanks.  If there were any patches that would succeed, it would be these -- unless unstream has no interest in having linrad build on the CURRENT version of gcc.
Comment 3 Diane Bruce freebsd_committer freebsd_triage 2015-04-28 11:26:57 UTC
Actually I had marked the port as in progress already and it was in poudriere already. Doesn't matter to me if you want to finish it though.

I have had some luck in fixing some of the upstream code in the past. I'll catch you two on IRC.
Comment 4 commit-hook freebsd_committer freebsd_triage 2015-05-01 16:26:34 UTC
A commit references this bug:

Author: db
Date: Fri May  1 16:25:52 UTC 2015
New revision: 385126
URL: https://svnweb.freebsd.org/changeset/ports/385126

Log:
  Fix linrad on latest gcc

  I checked linrad upstream, and they still haven't fixed these two bugs.  I am surprised they haven't been reported yet.  Without these fixes, linrad cannot be built with gcc5.

  the menu.c patch simply reverses the order of the condition.  One must check the bounds constraint first!  It's a pretty dumb mistake but I've seen this kind before.

  The second one fails because -Werror is set.  This took me a while because I couldn't figure out the relationship between ADCHANS and rxchan.  In any case, setting 4 locations per channel did indeed allow the array to be big enough.  (at first I thought the loop was running too high, but I finally determined the array was too small).

  These were found on DragonFly that uses gcc5.

  This patch has not been tested on FreeBSD but I can't how it could possibly fail.

  It would be good if the ham@ maintainer reports the issue upstream.

  Updated patch files using make makepatch

  PR:			ports/199737
  Submitted by:		marino

Changes:
  head/comms/linrad/Makefile
  head/comms/linrad/files/patch-Makefile.in
  head/comms/linrad/files/patch-buf.c
  head/comms/linrad/files/patch-caliq.c
  head/comms/linrad/files/patch-configure
  head/comms/linrad/files/patch-elektor.c
  head/comms/linrad/files/patch-help.c
  head/comms/linrad/files/patch-libfind1.c
  head/comms/linrad/files/patch-libfind2.c
  head/comms/linrad/files/patch-loadusb.h
  head/comms/linrad/files/patch-lxsys.c
  head/comms/linrad/files/patch-menu.c
  head/comms/linrad/files/patch-users.c
  head/comms/linrad/files/patch-wse_sdrxx.c
  head/comms/linrad/pkg-plist