Bug 244233

Summary: devel/json-c: Fix build with clang 10.0.0
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Po-Chuan Hsieh <sunpoet>
Status: Closed FIXED    
Severity: Affects Some People Flags: bugzilla: maintainer-feedback? (sunpoet)
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 244251    
Attachments:
Description Flags
Fix -Werror warning from clang 10.0.0 none

Description Dimitry Andric freebsd_committer freebsd_triage 2020-02-19 19:42:45 UTC
Created attachment 211764 [details]
Fix -Werror warning from clang 10.0.0

Fix the following -Werror warning from clang 10.0.0:

json_object.c:701:26: error: implicit conversion from 'long long' to 'double' changes value from 9223372036854775807 to 9223372036854775808 [-Werror,-Wimplicit-int-float-conversion]
                if (jso->o.c_double >= INT64_MAX)
                                    ~~ ^~~~~~~~~
/usr/include/x86/_stdint.h:94:19: note: expanded from macro 'INT64_MAX'
#define INT64_MAX       0x7fffffffffffffffLL
                        ^~~~~~~~~~~~~~~~~~~~

Similar to fixes I made in head, the solution is to cast INT64_MAX to
double before comparing.
Comment 1 commit-hook freebsd_committer freebsd_triage 2020-02-21 20:25:19 UTC
A commit references this bug:

Author: sunpoet
Date: Fri Feb 21 20:25:01 UTC 2020
New revision: 526713
URL: https://svnweb.freebsd.org/changeset/ports/526713

Log:
  Fix build with Clang 10

  PR:		244233
  Submitted by:	dim

Changes:
  head/devel/json-c/files/patch-json_object.c
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2020-02-21 20:26:30 UTC
Committed. Thanks!