Bug 707502 - -Wincompatible-pointer-types warning in devices/gdevxini.c
Summary: -Wincompatible-pointer-types warning in devices/gdevxini.c
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: Build Process (show other bugs)
Version: 10.02.0
Hardware: PC All
: P2 normal
Assignee: Default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-19 05:01 UTC by Sam James
Modified: 2024-01-19 10:44 UTC (History)
0 users

See Also:
Customer:
Word Size: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James 2024-01-19 05:01:58 UTC
Originally reported downstream at https://bugs.gentoo.org/922448.

Note that this is on ppc32.

```
powerpc-unknown-linux-gnu-gcc  -DHAVE_MKSTEMP -DHAVE_FILE64 -DHAVE_FSEEKO -DHAVE_MKSTEMP64 -DHAVE_FONTCONFIG -DHAVE_LIBIDN -DHAVE_SETLOCALE   -DHAVE_BSWAP32 -DHAVE_BYTESWAP_H -DHAVE_STRERROR -DHAVE_ISNAN -DHAVE_ISINF  -DHAVE_PREAD_PWRITE=1 -DGS_RECURSIVE_MUTEXATTR=PTHREAD_MUTEX_RECURSIVE -O2 -DNDEBUG -fPIC  -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -Wall -Wstrict-prototypes -Wundef -Wmissing-declarations -Wmissing-prototypes -Wwrite-strings -fno-strict-aliasing -Werror=declaration-after-statement -fno-builtin -fno-common -Werror=return-type -Wno-unused-local-typedefs -DHAVE_STDINT_H=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_DIR_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TIMES_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIBDL=1 -DGX_COLOR_INDEX_TYPE="unsigned long long" -D__USE_UNIX98=1  -DBUILD_PDF=1 -I./pdf -O2 -mcpu=7450 -mtune=7450 -pipe -DHAVE_RESTRICT=1  -DUSE_LIBPAPER  -fno-strict-aliasing -DHAVE_POPEN_PROTO=1   -fPIC  -fvisibility=hidden -DGSDLLEXPORT="__attribute__((visibility(\"default\")))" -I./soobj -I./base -I./devices  -DWHICH_CMS="lcms2"  -o ./soobj/gdevxini.o -c ./devices/gdevxini.c
./devices/gdevxini.c: In function 'x_set_buffer':
./devices/gdevxini.c:626:69: error: passing argument 4 of 'gdev_mem_data_size' from incompatible pointer type [-Wincompatible-pointer-types]
  626 |             if (gdev_mem_data_size(mdev, xdev->width, xdev->height, &space) < 0 ||
      |                                                                     ^~~~~~
      |                                                                     |
      |                                                                     ulong * {aka long unsigned int *}
In file included from ./devices/gdevxini.c:23:
./base/gxdevmem.h:192:46: note: expected 'size_t *' {aka 'unsigned int *'} but argument is of type 'ulong *' {aka 'long unsigned int *'}
  192 |                          int height, size_t *size);
      |                                      ~~~~~~~~^~~~
```

Newer compiler versions are planning on making incompatible-pointer-types error out by default which is what's happening here (gcc 14).
Comment 1 Ken Sharp 2024-01-19 08:47:35 UTC
I believe this commit 8f5c77af6c0b84bdea719010cf4f67877e857b2b will fix that, but.....

We have no way to check, as we don't have a 32-bit PPC machine with X11. I'm going to close the bug anyway, but if this doesn't solve the problem please reopen it.
Comment 2 Sam James 2024-01-19 10:44:48 UTC
Many thanks for the quick fix. Confirmed that works.