libIDL/libIDL-0.8.14-long-long-format-warnings.patch
DistroBaker 8e92a6db78 Merged update from upstream sources
This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/libIDL.git#60e1b2a45ce0d63092c235448cee94175566cf74
2021-02-05 21:36:07 +00:00

32 lines
1.3 KiB
Diff

On platforms (such as 64-bit Linux), where long long int and long int are both
64-bit, we can have IDL_LL defined to ll (format with %%lld) while
IDL_longlong_t, which is just gint64, may be ultimately defined to long int.
This results in compiler warnings about the mismatch between the long long
format and long parameter, even though the types are compatible. We can fix
this with a cast to long long before formatting.
diff -Naur libIDL-0.8.14-original/parser.y libIDL-0.8.14/parser.y
--- libIDL-0.8.14-original/parser.y 2009-04-18 08:20:37.000000000 -0400
+++ libIDL-0.8.14/parser.y 2021-02-03 12:37:11.067509562 -0500
@@ -1354,7 +1354,7 @@
} else if (value < 0) {
yywarningv (IDL_WARNING1, "Cannot use negative value %"
IDL_LL "d, using %" IDL_LL "d",
- value, -value);
+ (long long) value, (long long) -value);
if (ident)
IDL_tree_warning (ident,
IDL_WARNING1, "From constant declared here");
diff -Naur libIDL-0.8.14-original/util.c libIDL-0.8.14/util.c
--- libIDL-0.8.14-original/util.c 2009-04-18 08:20:37.000000000 -0400
+++ libIDL-0.8.14/util.c 2021-02-03 12:42:13.641470825 -0500
@@ -2818,7 +2818,7 @@
case IDLN_INTEGER:
/* FIXME: sign */
- dataf (data, "%" IDL_LL "d", IDL_INTEGER (p).value);
+ dataf (data, "%" IDL_LL "d", (long long) IDL_INTEGER (p).value);
break;
case IDLN_FIXED: