Bug 244645

Summary: biology/jellyfish: Fix biology/jellyfish build with clang 10.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Jason W. Bacon <jwb>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (jwb)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 244251    
Attachments:
Description Flags
Fix biology/jellyfish build with clang 10.0.0 none

Description Dimitry Andric freebsd_committer freebsd_triage 2020-03-06 19:48:25 UTC
Created attachment 212207 [details]
Fix biology/jellyfish build with clang 10.0.0

As reported in bug 244251, with clang 10.0.0 the biology/jellyfish port runs into -Werror warnings:

lib/jsoncpp.cpp:2303:74: error: implicit conversion from 'const Json::Int64' (aka 'const long long') to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
      JSON_ASSERT_MESSAGE( value_.real_ >= minInt64  &&  value_.real_ <= maxInt64, "Real out of Int64 range" );
                                                                      ~~ ^~~~~~~~
lib/jsoncpp.cpp:1566:58: note: expanded from macro 'JSON_ASSERT_MESSAGE'
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) JSON_FAIL_MESSAGE( message )
                                                         ^~~~~~~~~
lib/jsoncpp.cpp:2331:67: error: implicit conversion from 'const Json::UInt64' (aka 'const unsigned long long') to 'double' changes value from 18446744073709551615 to 18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
      JSON_ASSERT_MESSAGE( value_.real_ >= 0  &&  value_.real_ <= maxUInt64,  "Real out of UInt64 range" );
                                                               ~~ ^~~~~~~~~
lib/jsoncpp.cpp:1566:58: note: expanded from macro 'JSON_ASSERT_MESSAGE'
#define JSON_ASSERT_MESSAGE( condition, message ) if (!( condition )) JSON_FAIL_MESSAGE( message )
                                                         ^~~~~~~~~

This can be fixed by adding explicit casts.
Comment 1 commit-hook freebsd_committer freebsd_triage 2020-03-07 19:26:14 UTC
A commit references this bug:

Author: jwb
Date: Sat Mar  7 19:25:55 UTC 2020
New revision: 527971
URL: https://svnweb.freebsd.org/changeset/ports/527971

Log:
  biology/jellyfish: Patch for clang 10

  Add cast to silence implicit conversion error

  PR:             ports/244645
  Submitted by:   dim

Changes:
  head/biology/jellyfish/Makefile
  head/biology/jellyfish/files/patch-lib_jsoncpp.cpp
  head/biology/jellyfish/files/patch-sub__commands_count__main.cc
Comment 2 Jason W. Bacon freebsd_committer freebsd_triage 2020-03-07 19:26:59 UTC
Thanks!