SOUP_METHOD_* macros incompatible with -Wcast-qual
Submitted by Slava Semushin
Assigned to libsoup-maint@gnome.bugs
Link to original bug (#600315)
Description
I cannot compile mpdscribble 0.18.1 with libsoup 2.28.1. Before all works fine, but after one of latest libsoup updates lead regression in API.
Error message:
- make -j1 --silent --no-print-directory cc1: warnings being treated as errors src/http_client_soup.c: In function 'http_client_request': src/http_client_soup.c:140: error: cast discards qualifiers from pointer target type src/http_client_soup.c:163: error: cast discards qualifiers from pointer target type
Code:
SoupMessage *msg; msg = soup_message_new(SOUP_METHOD_POST, url); // line 140 msg = soup_message_new(SOUP_METHOD_GET, url); // line 163
And there no casting in code, but exists in libsoup's macros (from soup-method.h):
#define SOUP_METHOD_POST _SOUP_INTERN_METHOD (POST) #define _SOUP_INTERN_METHOD(method) (_SOUP_ATOMIC_INTERN_STRING (SOUP_METHOD##method, #method)) #define _SOUP_ATOMIC_INTERN_STRING(variable, value) ((const char *)(g_atomic_pointer_get (&(variable)) ? (variable) : (g_atomic_pointer_set (&(variable), (gpointer)g_intern_static_string (value)), (variable))))
So, please fix it.
Thanks in advance!
Version: 2.28.x