8000 IM_FREEF: void value not ignored as it ought to be · Issue #127 · libvips/nip2 · GitHub
[go: up one dir, main page]

Skip to content

IM_FREEF: void value not ignored as it ought to be #127

Open

Description

@agoode
gtkutil.c: In function ‘get_geditable_name’:
gtkutil.c:612:17: error: void value not ignored as it ought to be
  612 |                 IM_FREEF( g_free, name );              

It looks like newer glib versions define g_free as a macro and it's conflicting with IM_FREEF?

This is how the preprocessor expands it:

 {
  if (name) {
    (void) (__builtin_object_size (((name)), 0) != ((size_t) - 1)) ? g_free_sized ((name), __builtin_object_size (((name)), 0)) : (g_free) ((name));
    (name) = 0;
  }
} while (0);

Doing a little digging, the (void) is throwing away the result of the condition and triggering the error, like this:

((void) a) ? b : c; 

I'm not sure exactly what to do about this since it is in layers of compatibility macros. Probably the correct fix is to the macro in libvips?

Activity

  1. jcupitt commented on Jun 13, 2026

    @jcupitt
    Member

    Hi Adam,

    The IM_*() macros are deprecated vips7 compatibility code, it's now VIPS_FREE() which doesn't have this problem.

    Did you see nip4? It's nip2 moved over to vips8, gtk4 and the latest gobject (hopefully) conventions.

    https://github.com/libvips/nip4

  2. agoode commented on Jun 13, 2026

    @agoode
    Author

    Is nip4 a complete replacement for nip2 now? If so, I can look into winding down nip2 in Fedora in favor of nip4.

  3. jcupitt commented on Jun 13, 2026

    @jcupitt
    Member

    Yes, it's taken six (I think?) years, but it's finished now. A Fedora package for nip4 would be great! Hopefully it's a simple thing to package, please let me know if you find a rough edge.

    I should update the nip2 README to say it's now fully replaced, thanks for the reminder.

  4. kleisauke commented on Jun 14, 2026

    @kleisauke
    Member

    Thanks for maintaining the Fedora packages for nip2 and libvips!

    For reference, the VIPS_FREEF macro had the same issue, which was fixed in commit libvips/libvips@abb4dfa. As a quick workaround, you can try this sed replacement:

    find . -name '*.c' -exec sed -i "s/IM_FREEF( g_free/VIPS_FREEF( g_free/g" {} \;

    (untested)

    That said, it would be preferable to package nip4 for Fedora, since nip2 depends on GTK 2, which is being removed by most Linux distros. Also, starting with libvips 8.19, deprecated components will no longer be built by default (see commit libvips/libvips@35ca5d4).

  5. jcupitt commented on Jun 14, 2026

    @jcupitt
    Member

    The other bad dep is goffice-0.8. I think with nip2 gone this could probably be removed too. I know Debian have been moaning about nip2 keeping goffice-0.8 alive for many years now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0