FreeBSD Bugzilla – Attachment 211764 Details for
Bug 244233
devel/json-c: Fix build with clang 10.0.0
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fix -Werror warning from clang 10.0.0
devel__json-c-fix-casts-1.diff (text/plain), 1.66 KB, created by
Dimitry Andric
on 2020-02-19 19:42:45 UTC
(
hide
)
Description:
Fix -Werror warning from clang 10.0.0
Filename:
MIME Type:
Creator:
Dimitry Andric
Created:
2020-02-19 19:42:45 UTC
Size:
1.66 KB
patch
obsolete
>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. > > >Index: devel/json-c/files/patch-json__object.c >=================================================================== >--- devel/json-c/files/patch-json__object.c (nonexistent) >+++ devel/json-c/files/patch-json__object.c (working copy) >@@ -0,0 +1,14 @@ >+--- json_object.c.orig 2020-02-18 20:12:20 UTC >++++ json_object.c >+@@ -698,9 +698,9 @@ int64_t json_object_get_int64(const struct json_object >+ case json_type_int: >+ return jso->o.c_int64; >+ case json_type_double: >+- if (jso->o.c_double >= INT64_MAX) >++ if (jso->o.c_double >= (double)INT64_MAX) >+ return INT64_MAX; >+- if (jso->o.c_double <= INT64_MIN) >++ if (jso->o.c_double <= (double)INT64_MIN) >+ return INT64_MIN; >+ return (int64_t)jso->o.c_double; >+ case json_type_boolean: > >Property changes on: devel/json-c/files/patch-json__object.c >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 244233
: 211764