Skip to content

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

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions