Skip to content

gerror: Emit a critical warning if the message format is NULL

Philip Withnall requested to merge pwithnall/glib:2913-error-warning into main

The code has warned about this since commit 6d9f8743 in 2011.

glibc 2.37 has just started asserting if a NULL format is passed to sprintf(), which caused the existing GLib workaround to start asserting too.

Bite the bullet and upgrade the warning for format != NULL to a critical warning. Projects have had 12 years to fix their code.

The original bug reports (https://bugzilla.gnome.org/show_bug.cgi?id=660371, https://bugzilla.gnome.org/show_bug.cgi?id=560482) are actually both about a domain which is 0, rather than a format which is NULL, which gives some confidence that this change will actually impact very little third party code.

Since it doesn’t currently need changing, I have not touched the warning about domain != 0.

Signed-off-by: Philip Withnall pwithnall@endlessos.org

Fixes: #2913 (closed)

Closes #2913 (closed)

Merge request reports