{
GError *error;
+ /* Historically, GError allowed this (although it was never meant to work),
+ * and it has significant use in the wild, which g_return_val_if_fail
+ * would break. It should maybe g_return_val_if_fail in GLib 4.
+ * (GNOME#660371, GNOME#560482)
+ */
+ g_warn_if_fail (domain != 0);
+ g_warn_if_fail (format != NULL);
+
error = g_slice_new (GError);
error->domain = domain;
GError *copy;
g_return_val_if_fail (error != NULL, NULL);
+ /* See g_error_new_valist for why these don't return */
+ g_warn_if_fail (error->domain != 0);
+ g_warn_if_fail (error->message != NULL);
copy = g_slice_new (GError);
/**
* g_error_matches:
- * @error: a #GError or %NULL
+ * @error: (allow-none): a #GError or %NULL
* @domain: an error domain
* @code: an error code
*
/**
* g_set_error:
- * @err: a return location for a #GError, or %NULL
+ * @err: (allow-none): a return location for a #GError, or %NULL
* @domain: error domain
* @code: error code
* @format: printf()-style format
/**
* g_set_error_literal:
- * @err: a return location for a #GError, or %NULL
+ * @err: (allow-none): a return location for a #GError, or %NULL
* @domain: error domain
* @code: error code
* @message: error message
/**
* g_prefix_error:
- * @err: a return location for a #GError, or %NULL
+ * @err: (allow-none): a return location for a #GError, or %NULL
* @format: printf()-style format string
* @...: arguments to @format
*