Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure with GCC 14 #9

Open
remicollet opened this issue Feb 16, 2024 · 0 comments
Open

Build failure with GCC 14 #9

remicollet opened this issue Feb 16, 2024 · 0 comments

Comments

@remicollet
Copy link

Using GCC 14, [-Wincompatible-pointer-types] is now an error

builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_allocation.c: In function ‘_ion_strdup’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_allocation.c:95:42: error: pointer type mismatch in conditional expression [-Wincompatible-pointer-types]
   95 |     memcpy(dst->value, (is_empty) ? "\0" : src->value, (is_empty) ? 1 : src->length);
      |                                          ^
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_allocation.c:95:37: note: first expression has type ‘char *’
   95 |     memcpy(dst->value, (is_empty) ? "\0" : src->value, (is_empty) ? 1 : src->length);
      |                                     ^~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_allocation.c:95:44: note: second expression has type ‘BYTE *’ {aka ‘unsigned char *’}
   95 |     memcpy(dst->value, (is_empty) ? "\0" : src->value, (is_empty) ? 1 : src->length);
      |                                            ^~~~~~~~~~


In file included from /builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:16:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c: In function ‘ion_binary_read_ion_int’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_internal.h:113:35: warning: this ‘while’ clause does not guard... [-Wmisleading-indentation]
  113 |                                 } while(FALSE)
      |                                   ^~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:288:9: note: in expansion of macro ‘ION_GET’
  288 |         ION_GET(pstream, b);
      |         ^~~~~~~
In file included from /builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/include/ionc/ion.h:36,
                 from /builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_internal.h:33:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/include/ionc/ion_debug.h:72:26: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘while’
   72 | #define IONCHECK(x)      { err = x; if (err) goto fail; }
      |                          ^
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:289:9: note: in expansion of macro ‘IONCHECK’
  289 |         IONCHECK(_ion_binary_read_ion_int_helper(pstream, len, is_negative, p_value, b));
      |         ^~~~~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c: In function ‘ion_binary_read_int_64_and_sign’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_internal.h:112:71: error: passing argument 2 of ‘ion_stream_read_byte’ from incompatible pointer type [-Wincompatible-pointer-types]
  112 |                                   IONCHECK(ion_stream_read_byte((xh), &(xb)));  \
      |                                                                       ^~~~~
      |                                                                       |
      |                                                                       uint64_t * {aka long unsigned int *}
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/include/ionc/ion_debug.h:72:34: note: in definition of macro ‘IONCHECK’
   72 | #define IONCHECK(x)      { err = x; if (err) goto fail; }
      |                                  ^
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:347:9: note: in expansion of macro ‘ION_GET’
  347 |         ION_GET(pstream, b);
      |         ^~~~~~~
In file included from /builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/include/ionc/ion.h:32:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/include/ionc/ion_stream.h:231:78: note: expected ‘int *’ but argument is of type ‘uint64_t *’ {aka ‘long unsigned int *’}
  231 | ION_API_EXPORT iERR ion_stream_read_byte           (ION_STREAM *stream, int *p_c);
      |                                                                         ~~~~~^~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c: In function ‘ion_binary_read_double’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:414:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  414 |         *p_value = *((double *)&intvalue);
      |                     ~^~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:418:22: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  418 |         *p_value = *((float *)&intvalue);
      |                     ~^~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c: In function ‘ion_binary_write_float_32_value’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:531:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  531 |     intvalue = *((int_type *)&value); \
      |                 ~^~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:552:1: note: in expansion of macro ‘ION_BINARY_WRITE_FLOAT_BUILDER’
  552 | ION_BINARY_WRITE_FLOAT_BUILDER(ion_binary_write_float_32_value, float, uint32_t, UINT_32_IMAGE_LENGTH, 4)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c: In function ‘ion_binary_write_float_64_value’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:531:18: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  531 |     intvalue = *((int_type *)&value); \
      |                 ~^~~~~~~~~~~~~~~~~~~
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_binary.c:554:1: note: in expansion of macro ‘ION_BINARY_WRITE_FLOAT_BUILDER’
  554 | ION_BINARY_WRITE_FLOAT_BUILDER(ion_binary_write_float_64_value, double, uint64_t, UINT_64_IMAGE_LENGTH, 8)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[4]: *** [ionc/CMakeFiles/objlib.dir/build.make:104: ionc/CMakeFiles/objlib.dir/ion_binary.c.o] Error 1
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_collection.c: In function ‘_ion_collection_compare’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_collection.c:227:13: warning: suggest parentheses around comparison in operand of ‘^’ [-Wparentheses]
  227 |     if (lhs == NULL ^ rhs == NULL) {
      |             ^
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/decNumber/decimal32.c:30:10: warning: "DECNUMDIGITS" redefined
   30 | #define  DECNUMDIGITS  7      // make decNumbers with space for 7
      |          ^~~~~~~~~~~~
<command-line>: note: this is the location of the previous definition
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_catalog.c: In function ‘_ion_catalog_find_best_match_helper’:
/builddir/build/BUILD/php-pecl-ion-0.2.1/ion-0.2.1/ion-c/ionc/ion_catalog.c:265:43: warning: unused variable ‘best_name’ [-Wunused-variable]
  265 |     ION_STRING               symtab_name, best_name, system_name;
      |                                           ^~~~~~~~~

Only for your information as this is not in this project but in used library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant