Bug 1223892 - Gimp does not build with GCC 14 because of use of incompatible pointer types
Summary: Gimp does not build with GCC 14 because of use of incompatible pointer types
Status: RESOLVED FIXED
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Other (show other bugs)
Version: Current
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Paolo Stivanin
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: modern_C
  Show dependency treegraph
 
Reported: 2024-05-03 18:52 UTC by Martin Jambor
Modified: 2024-06-11 09:08 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Jambor 2024-05-03 18:52:28 UTC
Gimp fails when built with GCC 14 because of use incompatible pointer
types, which used to be warnings in previous versions of GCC but are
errors by default in GCC 14.  For more information, see
https://gcc.gnu.org/gcc-14/porting_to.html

Upstream issues seem to be:
 - https://gitlab.gnome.org/GNOME/gimp/-/issues/8807 and
 - https://gitlab.gnome.org/GNOME/gimp/-/issues/8649

but perhaps there are others.

Corresponding Gentoo bug is https://bugs.gentoo.org/875413

Failed build log is available at:
https://build.opensuse.org/package/live_build_log/home:rguenther:plgrnd/gimp/openSUSE_Factory/x86_64
Comment 1 Dominique Leuenberger 2024-05-21 08:21:24 UTC
Assigning to Paolo - seems to have done much more work on gimp than me
Comment 2 Paolo Stivanin 2024-05-21 08:23:56 UTC
looking into it!
Comment 3 Paolo Stivanin 2024-05-21 09:57:54 UTC
@Martin: can you please try with the patch I added here https://build.opensuse.org/package/show/home:polslinux:branches:graphics/gimp ? thanks
Comment 4 Martin Jambor 2024-05-21 10:27:22 UTC
(In reply to Paolo Stivanin from comment #3)
> @Martin: can you please try with the patch I added here
> https://build.opensuse.org/package/show/home:polslinux:branches:graphics/
> gimp ? thanks

You can try yourself with

  osc build --alternative-project home:rguenther:nextgcc

Because it may take a me day or three before I get to it.

Thanks for dealing with this!
Comment 5 Paolo Stivanin 2024-05-21 11:17:54 UTC
Thanks! The patch is not enough, there are more things to fix.
Comment 6 Paolo Stivanin 2024-05-21 11:36:02 UTC
Tested on tumbleweed, all good: https://build.opensuse.org/request/show/1175538

compiles fine now with gcc14
Comment 7 Martin Jambor 2024-05-31 19:42:35 UTC
(In reply to Paolo Stivanin from comment #6)
> Tested on tumbleweed, all good:
> https://build.opensuse.org/request/show/1175538
> 
> compiles fine now with gcc14

Unfortunately, it does not: https://build.opensuse.org/package/live_build_log/openSUSE:Factory:Staging:Gcc7/gimp/standard/x86_64

You can try locally with:
   osc build --clean --alternative-project home:rguenther:nextgcc standard

The failure stopping the build is:

[  178s] file-tiff-load.c: In function ‘load_image’:
[  178s] file-tiff-load.c:572:7: warning: ‘uint16’ is deprecated [-Wdeprecated-declarations]
[  178s]   572 |       uint16            planar  = PLANARCONFIG_CONTIG;
[  178s]       |       ^~~~~~
[  178s] file-tiff-load.c:1239:9: warning: ‘uint32’ is deprecated [-Wdeprecated-declarations]
[  178s]  1239 |         uint32        count       = 0;
[  178s]       |         ^~~~~~
[  178s] file-tiff-load.c:1372:56: error: passing argument 2 of ‘gimp_image_get_resolution’ from incompatible pointer type [-Wincompatible-pointer-types]
[  178s]  1372 |                     gimp_image_get_resolution (*image, &xres, &yres);
[  178s]       |                                                        ^~~~~
[  178s]       |                                                        |
[  178s]       |                                                        gfloat * {aka float *}
[  178s] In file included from ../../libgimp/gimp_pdb_headers.h:55,
[  178s]                  from ../../libgimp/gimp.h:66,
[  178s]                  from file-tiff-load.c:52:
[  178s] ../../libgimp/gimpimage_pdb.h:179:86: note: expected ‘gdouble *’ {aka ‘double *’} but argument is of type ‘gfloat *’ {aka ‘float *’}
[  178s]   179 |                                                                 gdouble             *xresolution,
[  178s]       |                                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
[  178s] file-tiff-load.c:1372:63: error: passing argument 3 of ‘gimp_image_get_resolution’ from incompatible pointer type [-Wincompatible-pointer-types]
[  178s]  1372 |                     gimp_image_get_resolution (*image, &xres, &yres);
[  178s]       |                                                               ^~~~~
[  178s]       |                                                               |
[  178s]       |                                                               gfloat * {aka float *}
[  178s] ../../libgimp/gimpimage_pdb.h:180:86: note: expected ‘gdouble *’ {aka ‘double *’} but argument is of type ‘gfloat *’ {aka ‘float *’}
[  178s]   180 |                                                                 gdouble             *yresolution);
[  178s]       |                                                                 ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
Comment 8 Paolo Stivanin 2024-06-10 06:19:02 UTC
It's working fine for me:

$ osc build --clean --alternative-project home:rguenther:nextgcc standard
....
[  368s] Check time report (>1% & >0.1s):
[  368s]     Check                            Duration (in s)   Fraction (in %)  Checked files
[  368s]     BinariesCheck                                5.5              57.1               
[  368s]     ExtractRpm                                   1.6              16.4               
[  368s]     SignatureCheck                               0.5               5.5               
[  368s]     FilesCheck                                   0.5               5.4               
[  368s]     BashismsCheck                                0.4               4.2               
[  368s]     SharedLibraryPolicyCheck                     0.4               3.8               
[  368s]     BuildRootAndDateCheck                        0.3               3.3               
[  368s]     FilelistCheck                                0.1               1.3               
[  368s]     TOTAL                                        9.6             100.0               
[  368s] 
[  368s]  8 packages and 0 specfiles checked; 14 errors, 4 warnings, 295 filtered, 110 badness; has taken 9.8 s 
[  368s] 
[  368s] ... running 01-delete-x86_64-subarches
[  368s] 
[  368s] suse-ws finished "build gimp.spec" at Mon Jun 10 06:18:12 UTC 2024.
[  368s] 

/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/SRPMS/gimp-2.10.38-0.src.rpm

/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/noarch/gimp-lang-2.10.38-0.noarch.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/libgimp-2_0-0-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-plugins-python-debuginfo-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-debugsource-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-devel-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-plugin-aa-debuginfo-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-plugins-python-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/libgimpui-2_0-0-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/libgimp-2_0-0-debuginfo-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/libgimpui-2_0-0-debuginfo-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-plugin-aa-2.10.38-0.x86_64.rpm
/var/tmp/build-root/standard-x86_64/home/abuild/rpmbuild/RPMS/x86_64/gimp-debuginfo-2.10.38-0.x86_64.rpm
Comment 9 Martin Jambor 2024-06-10 13:28:05 UTC
Unfortunately, when I check out the current factory version (r142,
last gimp.changes update has date "Mon May 6 07:20:05 UTC 2024"), and
try to build it with the same alternative, project, it fails with me
with a C99 viloations.  The forst one is:

[  142s] file-tiff-load.c:1372:56: error: passing argument 2 of ‘gimp_image_get_resolution’ from incompatible pointer type [-Wincompatible-pointer-types]
[  142s]  1372 |                     gimp_image_get_resolution (*image, &xres, &yres);
[  142s]       |                                                        ^~~~~
[  142s]       |                                                        |
[  142s]       |                                                        gfloat * {aka float *}
[  142s] In file included from ../../libgimp/gimp_pdb_headers.h:55,
[  142s]                  from ../../libgimp/gimp.h:66,
[  142s]                  from file-tiff-load.c:52:
[  142s] ../../libgimp/gimpimage_pdb.h:179:86: note: expected ‘gdouble *’ {aka ‘double *’} but argument is of type ‘gfloat *’ {aka ‘float *’}
[  142s]   179 |                                                                 gdouble             *xresolution,
[  142s]       |                                                                 ~~~~~~~~~~~~~~~~~
Comment 10 Paolo Stivanin 2024-06-11 07:22:23 UTC
That's because you are missing the fix itself. The fix was pushed on the 21st of May:

-------------------------------------------------------------------
Tue May 21 08:45:44 UTC 2024 - Paolo Stivanin <info@paolostivanin.com>

- Add fix-gcc14-build.patch (fix bsc#1223892)
Comment 11 Martin Jambor 2024-06-11 09:08:17 UTC
(In reply to Paolo Stivanin from comment #10)
> That's because you are missing the fix itself. The fix was pushed on the
> 21st of May:
> 
> -------------------------------------------------------------------
> Tue May 21 08:45:44 UTC 2024 - Paolo Stivanin <info@paolostivanin.com>
> 
> - Add fix-gcc14-build.patch (fix bsc#1223892)

I did the (clean) package check-out from Factory yesterday and did not
get the fix though.  I see that there is a submit request to factory,
so hopefully after it is accepted, the fix will be there as well.  Thanks.