Bug 197823 - science/massxpert : logic bug revealed by gcc5
Summary: science/massxpert : logic bug revealed by 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: Veniamin Gvozdikov
Depends on:
Reported: 2015-02-19 15:20 UTC by John Marino
Modified: 2015-03-22 00:09 UTC (History)
0 users

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


Note You need to log in before you can comment on or make changes to this bug.
Description John Marino freebsd_committer 2015-02-19 15:20:13 UTC
Attempting to build massxpert has reveal a logic bug:

/wrkdirs/science/massxpert/work/massxpert-3.4.0/lib/cleaveSpec.cpp: In member function 'bool massXpert::CleaveSpec::validate()':
/wrkdirs/science/massxpert/work/massxpert-3.4.0/lib/cleaveSpec.cpp:430:17: error: comparison of constant '-1' with boolean expression is always false [-Werror=bool-compare]
     if (parse() == -1)
cc1plus: all warnings being treated as errors

I could try fixing it but I think it's better if the maintainer takes a look first (and perhaps contact upstream)
Comment 1 Bugzilla Automation freebsd_committer 2015-02-19 15:20:13 UTC
Auto-assigned to maintainer vg@FreeBSD.org
Comment 2 John Marino freebsd_committer 2015-03-11 17:57:53 UTC
vg, can you take a look a this?
Comment 3 Veniamin Gvozdikov freebsd_committer 2015-03-12 10:04:45 UTC
I checked massexpert update - they haven't if you know how to fix that issues, you are welcome to fix it.
Comment 4 John Marino freebsd_committer 2015-03-12 10:10:42 UTC
I can make the error go away.  The question is whether or not the logic will be correct (I haven't actually looked yet)

Is this some kind of university student-written software?  In any case, a bug report should be filed since I suspect they want gcc to be able to compile it.

I'll take a look to try to fix it, but really upstream should care about this since it's a real programming flaw.
Comment 5 commit-hook freebsd_committer 2015-03-22 00:07:24 UTC
A commit references this bug:

Author: marino
Date: Sun Mar 22 00:06:36 UTC 2015
New revision: 381882
URL: https://svnweb.freebsd.org/changeset/ports/381882

  science/massxpert: Fix two logical errors (found by gcc5)

  There were two boolean logic issues found by gcc5 when compiling
  massxpert.  One was comparing boolean output to a negative integer
  (is always false) and the other applied the "not" operator in the wrong
  place.  Fix provided per request by maintainer.

  PR:	197823

Comment 6 John Marino freebsd_committer 2015-03-22 00:09:39 UTC
fixed, hopefully correctly.  Can't be worse ...