Bug 244233 - devel/json-c: Fix build with clang 10.0.0
Summary: devel/json-c: Fix build with clang 10.0.0
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Sunpoet Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks: 244251
  Show dependency treegraph
 
Reported: 2020-02-19 19:42 UTC by Dimitry Andric
Modified: 2020-02-21 20:26 UTC (History)
0 users

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


Attachments
Fix -Werror warning from clang 10.0.0 (1.66 KB, patch)
2020-02-19 19:42 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dimitry Andric freebsd_committer 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 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 Sunpoet Po-Chuan Hsieh freebsd_committer 2020-02-21 20:26:30 UTC
Committed. Thanks!