Fix incompatible type conversion errors

Review Request #2944 — Created Jan. 31, 2024 and submitted

Information

pidgin/pidgin
release-2.x.y

Reviewers

  • A recent libxml2 changed its handler function to take a const pointer. It's
    safe for us to have it, and them not, but the opposite way causes an implicit
    cast warning.
  • In relatively new GLib (many years now), g_object_ref casts its output to
    match its input. This means we should not be casting to G_OBJECT, as that
    is not the type it expects, and would translate to the output being GObject
    instead of the original type.

This fixes the build in Fedora 40, which changes several incompatible pointer
conversion warnings into errors.

This patch is partially from the Fedora maintainer @yarda, with some corrections by me (to the g_object_ref portions.)

Compiled in a Rawhide environment with this patch applied.

Summary ID
Fix incompatible type conversion errors
- A recent libxml2 changed its handler function to take a `const` pointer. - In relatively new GLib (many years now), `g_object_ref` casts its output to match its input. This means we should not be casting to `G_OBJECT`, as that is not the type it expects, and would translate to the output being `GObject` instead of the original type. This fixes the build in Fedora 40, which changes several incompatible pointer conversion warnings into errors.
81db6eb1e6268a8a76a03400e68f93106e3e61a9
grim
  1. Awesome work, thanks!!

  2. 
      
grim
Review request changed

Status: Closed (submitted)

Loading...