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

GCC14 c99 - fails to compile (error: assignment to 'GFile *' {aka 'struct _GFile *'} from incompatible pointer type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types])GCC14 c99 - #693

Closed
immolo opened this issue Jan 6, 2024 · 9 comments

Comments

@immolo
Copy link

immolo commented Jan 6, 2024

With the upcoming changes to GCC14 now adding ModernC like LLVM16 did Pluma-1.26.1 fails to compile although the issue is already resolved in 1.27.0.

pluma-file-bookmarks-store.c: In function 'pluma_file_bookmarks_store_get_uri':
pluma-file-bookmarks-store.c:853:22: error: assignment to 'GFile *' {aka 'struct _GFile *'} from incompatible pointer type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types]
853 | file = g_object_ref (obj);
| ^
make[4]: *** [Makefile:614: pluma-file-bookmarks-store.lo] Error 1
make[4]: Leaving directory '/var/tmp/portage/app-editors/pluma-1.26.0-r2/work/pluma-1.26.0/plugins/filebrowser'
make[4]: *** Waiting for unfinished jobs....

Steps to reproduce:

Compile pluma-1.26.1 with the latest GCC14 snapshot or if using pre 14 then adding -Werror=implicit-function-declaration -Werror=implicit-int -Werror=int-conversion -Werror=incompatible-pointer-types to the compiler flags will do the same thing

This is currently being tracked as a Gentoo bug at https://bugs.gentoo.org/919088

@immolo immolo changed the title fails to compile (error: assignment to 'GFile *' {aka 'struct _GFile *'} from incompatible pointer type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types])GCC14 c99 - GCC14 c99 - fails to compile (error: assignment to 'GFile *' {aka 'struct _GFile *'} from incompatible pointer type 'GObject *' {aka 'struct _GObject *'} [-Wincompatible-pointer-types])GCC14 c99 - Jan 6, 2024
@NHOrus
Copy link

NHOrus commented Apr 2, 2024

Bug persists in pluma-1.26.1
Patch 6bd3418 applies cleanly, fixes problem.

@lukefromdc
Copy link
Member

lukefromdc commented Apr 2, 2024 via email

@NHOrus
Copy link

NHOrus commented Apr 2, 2024

What. It's your patch. From your repository. That's in 1.27.0 and 1.28.0
It pushes GFile * file declaration way down, mixing it with code.
It removes isfs variable completely.

@lukefromdc
Copy link
Member

lukefromdc commented Apr 2, 2024 via email

@NHOrus
Copy link

NHOrus commented Apr 2, 2024

https://inbox.sourceware.org/gcc-patches/cover.1700473918.git.fweimer@redhat.com/
GCC-14, out in two to four weeks, will turn incompatible pointer types into on-by-default error.
Because this kind of type assignment was not permitted in C99 and still not permitted in all C standards that follow

@lukefromdc
Copy link
Member

lukefromdc commented Apr 2, 2024 via email

@lukefromdc
Copy link
Member

Looking more closely: this seems to be a simple cherrypick of something we did and evaluated before. The c99 reference basically threw me off of this, as I normally ignore anything that is C99 only. An incompatable pointer type is a whole different issue though, and this should be fixable with a cherrypick to 1.26.

I had mistaken this for an issue against current master and 1.28

@lukefromdc
Copy link
Member

Thanks for cherrypicking with
9f033b7
on Jan 25, looks like what we need is a new 1.26 release so distros can pick it up due to "Bug persists in pluma-1.26.1" the thread on this was very confusing to me

@lukefromdc
Copy link
Member

Translations broke on updating for 1.26.2, so I have to revert that update and release 1.26.3 using the same translations as 1.26.1.

Version 1.26.3 with the fix for this included is out and available to distros, so we should be finished with this. Feel free to reopen or to open a new report if gcc-3.14 issues persist

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

3 participants