modem-manager: build issue
Current mm 1.6.12 produces following errors both when compiling an ARM or MIPS target:
CC ModemManager-mm-base-modem.omm-base-manager.c: In function ?handle_set_logging?:
mm-base-manager.c:680:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
ctx->self = g_object_ref (manager);
^
mm-base-manager.c: In function ?handle_scan_devices?:
mm-base-manager.c:736:15: error: assignment from incompatible pointer
type [-Werror=incompatible-pointer-types]
ctx->self = g_object_ref (manager);
^
mm-device.c: In function ?mm_device_get_plugin?:
mm-device.c:628:12: error: return from incompatible pointer type
[-Werror=incompatible-pointer-types]
return (self->priv->plugin ?So far I've seen only one build failure in our autobuilders [0]. I can reproduce this error building mm 1.6.12 locally with my host GCC. But the master branch of mm compiles without any issue. We don't seem to be the only ones who is affected [1], [2].
Any ideas?
[0] http://autobuild.buildroot.net/results/5d9e299ff12726d07e8a584a213c1d2a2e419594/
[1] https://fedorapeople.org/groups/risc-v/logs/ModemManager-1.6.12-3.fc28.src.rpm/build.log
[2] https://www.linuxquestions.org/questions/slackware-14/slackware-from-scratch-and-x11-4175560702/page19.html
Yegor
Hello,
Quoted 19 lines · Yegor Yefremov
Current mm 1.6.12 produces following errors both when compiling an ARM or MIPS target:
CC ModemManager-mm-base-modem.o
mm-base-manager.c: In function ?handle_set_logging?:
mm-base-manager.c:680:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]ctx->self = g_object_ref (manager); ^ mm-base-manager.c: In function ?handle_scan_devices?: mm-base-manager.c:736:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ctx->self = g_object_ref (manager); ^ mm-device.c: In function ?mm_device_get_plugin?: mm-device.c:628:12: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] return (self->priv->plugin ?
Quoted 6 lines
So far I've seen only one build failure in our autobuilders [0]. I can reproduce this error building mm 1.6.12 locally with my host GCC. But the master branch of mm compiles without any issue. We don't seem to be the only ones who is affected [1], [2].
Any ideas?
Yes:
https://git.buildroot.org/buildroot/commit/?id=f9b6ec3b59746f3eddd387772ad60aa6bc52aa60
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
Quoted 27 lines · Thomas Petazzoni
Hello,
Quoted 24 lines · Yegor Yefremov
Current mm 1.6.12 produces following errors both when compiling an ARM or MIPS target:
CC ModemManager-mm-base-modem.o
mm-base-manager.c: In function ?handle_set_logging?:
mm-base-manager.c:680:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]ctx->self = g_object_ref (manager); ^ mm-base-manager.c: In function ?handle_scan_devices?: mm-base-manager.c:736:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ctx->self = g_object_ref (manager); ^ mm-device.c: In function ?mm_device_get_plugin?: mm-device.c:628:12: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] return (self->priv->plugin ?So far I've seen only one build failure in our autobuilders [0]. I can reproduce this error building mm 1.6.12 locally with my host GCC. But the master branch of mm compiles without any issue. We don't seem to be the only ones who is affected [1], [2].
Quoted 4 lines
Quoted 1 line
Any ideas?
Yes:
https://git.buildroot.org/buildroot/commit/?id=f9b6ec3b59746f3eddd387772ad60aa6bc52aa60
I already have this commit and I've used various GCC versions > 4.7 i.e. 5.x and 7.x
Yegor
Hello,
Quoted 25 lines · Yegor Yefremov
Quoted 25 lines · Yegor Yefremov
Quoted 24 lines
Current mm 1.6.12 produces following errors both when compiling an ARM or MIPS target:
CC ModemManager-mm-base-modem.o
mm-base-manager.c: In function ?handle_set_logging?:
mm-base-manager.c:680:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]ctx->self = g_object_ref (manager); ^ mm-base-manager.c: In function ?handle_scan_devices?: mm-base-manager.c:736:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ctx->self = g_object_ref (manager); ^ mm-device.c: In function ?mm_device_get_plugin?: mm-device.c:628:12: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] return (self->priv->plugin ?So far I've seen only one build failure in our autobuilders [0]. I can reproduce this error building mm 1.6.12 locally with my host GCC. But the master branch of mm compiles without any issue. We don't seem to be the only ones who is affected [1], [2].
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Any ideas?
Yes:
https://git.buildroot.org/buildroot/commit/?id=f9b6ec3b59746f3eddd387772ad60aa6bc52aa60I already have this commit and I've used various GCC versions > 4.7 i.e. 5.x and 7.x
Then I don't know. I assume reverting the commit doesn't change anything (it shouldn't) ? If it doesn't, then investigation needed, I don't have an immediate answer, sorry :-/
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
Quoted 33 lines
From: "Yegor Yefremov" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "Thomas Petazzoni" <[email protected]>, "Carlos Santos" <[email protected]>, "Aleksander Morgado" <[email protected]>
Sent: Wednesday, April 18, 2018 9:32:06 AM
Subject: modem-manager: build issueCurrent mm 1.6.12 produces following errors both when compiling an ARM or MIPS target:
CC ModemManager-mm-base-modem.o
mm-base-manager.c: In function ?handle_set_logging?:
mm-base-manager.c:680:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]ctx->self = g_object_ref (manager); ^ mm-base-manager.c: In function ?handle_scan_devices?: mm-base-manager.c:736:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ctx->self = g_object_ref (manager); ^ mm-device.c: In function ?mm_device_get_plugin?: mm-device.c:628:12: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] return (self->priv->plugin ?So far I've seen only one build failure in our autobuilders [0]. I can reproduce this error building mm 1.6.12 locally with my host GCC. But the master branch of mm compiles without any issue. We don't seem to be the only ones who is affected [1], [2].
Any ideas?
Quoted 8 lines
[0]
http://autobuild.buildroot.net/results/5d9e299ff12726d07e8a584a213c1d2a2e419594/
[1]
https://fedorapeople.org/groups/risc-v/logs/ModemManager-1.6.12-3.fc28.src.rpm/build.log
[2]
https://www.linuxquestions.org/questions/slackware-14/slackware-from-scratch-and-x11-4175560702/page19.htmlYegor
I'm quite busy right now but will try to reproduce the error tonight.
Signature · 4 lines
Carlos Santos (Casantos) - DATACOM, P&D ?The greatest triumph that modern PR can offer is the transcendent success of having your words and actions judged by your reputation, rather than the other way about.? ? Christopher Hitchens
Quoted 48 lines
From: "Carlos Santos" <[email protected]>
To: "Yegor Yefremov" <[email protected]>
Cc: "Thomas Petazzoni" <[email protected]>, "Aleksander Morgado" <[email protected]>, "buildroot" <[email protected]>
Sent: Wednesday, April 18, 2018 11:33:42 AM
Subject: Re: [Buildroot] modem-manager: build issueQuoted 41 lines
From: "Yegor Yefremov" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "Thomas Petazzoni" <[email protected]>, "Carlos Santos" <[email protected]>, "Aleksander
Morgado" <[email protected]>
Sent: Wednesday, April 18, 2018 9:32:06 AM
Subject: modem-manager: build issueCurrent mm 1.6.12 produces following errors both when compiling an ARM or MIPS target:
CC ModemManager-mm-base-modem.o
mm-base-manager.c: In function ?handle_set_logging?:
mm-base-manager.c:680:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]ctx->self = g_object_ref (manager); ^ mm-base-manager.c: In function ?handle_scan_devices?: mm-base-manager.c:736:15: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ctx->self = g_object_ref (manager); ^ mm-device.c: In function ?mm_device_get_plugin?: mm-device.c:628:12: error: return from incompatible pointer type [-Werror=incompatible-pointer-types] return (self->priv->plugin ?So far I've seen only one build failure in our autobuilders [0]. I can reproduce this error building mm 1.6.12 locally with my host GCC. But the master branch of mm compiles without any issue. We don't seem to be the only ones who is affected [1], [2].
Any ideas?
[0]
http://autobuild.buildroot.net/results/5d9e299ff12726d07e8a584a213c1d2a2e419594/
[1]
https://fedorapeople.org/groups/risc-v/logs/ModemManager-1.6.12-3.fc28.src.rpm/build.log
[2]
https://www.linuxquestions.org/questions/slackware-14/slackware-from-scratch-and-x11-4175560702/page19.html
Quoted 3 lines
Quoted 1 line
Yegor
I'm quite busy right now but will try to reproduce the error tonight.
There is a macro defined in build/libglib2-2.56.1/gobject/gobject.h which leads to the assignment errors:
511 /* Make reference APIs type safe with macros */
512 #define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
The problem can be easily reproduced with this sample code:
$ cat /tmp/test.c extern void *g_object_ref(void *);
/* Make reference APIs type safe with macros */
#define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
extern double *new_double(int *);
double *new_double(int *ip) {
double *dp;
dp = g_object_ref(ip);
return dp;
}
$ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o
/tmp/test.c: In function ?new_context?:
/tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
ctx->self = g_object_ref(om);
^
cc1: all warnings being treated as errorsSo in order to fix the build of ModemManager it would be necessary to either compile it without -Werror (with the risk of letting undesired assignments happen) or fix all the occurrences of the offending assignments.
Signature · 4 lines
Carlos Santos (Casantos) - DATACOM, P&D ?The greatest triumph that modern PR can offer is the transcendent success of having your words and actions judged by your reputation, rather than the other way about.? ? Christopher Hitchens
Hello,
Quoted 22 lines · Carlos Santos
There is a macro defined in
build/libglib2-2.56.1/gobject/gobject.hwhich leads to the assignment errors:511 /* Make reference APIs type safe with macros */
512 #defineg_object_ref(Obj)((__typeof__(Obj)) (g_object_ref) (Obj))The problem can be easily reproduced with this sample code:
$ cat /tmp/test.c extern void *g_object_ref(void *);/* Make reference APIs type safe with macros */
#defineg_object_ref(Obj)((__typeof__(Obj)) (g_object_ref) (Obj))extern double *new_double(int *);
double *new_double(int *ip) {
double *dp;
dp =g_object_ref(ip);
return dp;
}
Quoted 6 lines
$ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o
/tmp/test.c: In function ?new_context?:
/tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
ctx->self = g_object_ref(om);
^
cc1: all warnings being treated as errorsThanks for the investigation!
Quoted 3 lines
So in order to fix the build of ModemManager it would be necessary to either compile it without -Werror (with the risk of letting undesired assignments happen) or fix all the occurrences of the offending assignments.
If the patch to fix all the occurrences is small enough, we can do this in Buildroot, and submit upstream.
If the patch is larger, then disabling -Werror is a better solution for us, and report the issue upstream (or contribute the fix).
Best regards,
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com
Quoted 39 lines · Thomas Petazzoni
Hello,
Quoted 22 lines · Carlos Santos
There is a macro defined in
build/libglib2-2.56.1/gobject/gobject.hwhich leads to the assignment errors:511 /* Make reference APIs type safe with macros */
512 #defineg_object_ref(Obj)((__typeof__(Obj)) (g_object_ref) (Obj))The problem can be easily reproduced with this sample code:
$ cat /tmp/test.c extern void *g_object_ref(void *);/* Make reference APIs type safe with macros */
#defineg_object_ref(Obj)((__typeof__(Obj)) (g_object_ref) (Obj))extern double *new_double(int *);
double *new_double(int *ip) {
double *dp;
dp =g_object_ref(ip);
return dp;
}Quoted 6 lines
$ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o /tmp/test.c: In function ?new_context?: /tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] ctx->self = g_object_ref(om); ^ cc1: all warnings being treated as errorsThanks for the investigation!
Quoted 3 lines
So in order to fix the build of ModemManager it would be necessary to either compile it without -Werror (with the risk of letting undesired assignments happen) or fix all the occurrences of the offending assignments.
Quoted 5 lines
If the patch to fix all the occurrences is small enough, we can do this in Buildroot, and submit upstream.
If the patch is larger, then disabling -Werror is a better solution for us, and report the issue upstream (or contribute the fix).
I still wonder why the upstream MM doesn't have any compilation issues. cflags also have -Werror:
cflags: -Wall -Werror -std=gnu89 -g -O2
-Wmissing-declarations -Wmissing-prototypes -Wdeclaration-after-statement -Wno-unused-parameter -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-but-set-variable -Wformat-security
And the code is also the same (src/mm-base-manager.c):
typedef struct {
MMBaseManager *self;
GDBusMethodInvocation *invocation;
gchar *level;
} SetLoggingContext;static gbooleanhandle_set_logging (MmGdbusOrgFreedesktopModemManager1 *manager,
GDBusMethodInvocation *invocation, const gchar *level)
{
SetLoggingContext *ctx;
ctx = g_new0 (SetLoggingContext, 1);
ctx->self = g_object_ref (manager);
ctx->invocation = g_object_ref (invocation);
ctx->level = g_strdup (level);
mm_auth_provider_authorize (ctx->self->priv->authp,
invocation,
MM_AUTHORIZATION_MANAGER_CONTROL,
ctx->self->priv->authp_cancellable,
(GAsyncReadyCallback)set_logging_auth_ready,
ctx);
return TRUE;
}@Aleksander: any ETA for 1.8.0?
Yegor
PATCH 1/1 modem-manager: remove -Werror from CFLAGS
We are aproaching the 2018.05 release and modem-manager is still broken due to warnings like this:
mm-base-manager.c: In function 'handle_set_logging':
mm-base-manager.c:680:15: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
ctx->self = g_object_ref (manager);
^There is a macro defined in build/libglib2-2.56.1/gobject/gobject.h which leads to the assignment errors:
511 /* Make reference APIs type safe with macros */
512 #define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
The problem can be easily reproduced with this sample code:
$ cat test.c
extern void *g_object_ref(void *);
#define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
extern double *new_double(int *);
double *new_double(int *ip) {
double *dp;
dp = g_object_ref(ip);
return dp;
} $ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o
/tmp/test.c: In function ?new_context?:
/tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
ctx->self = g_object_ref(om);
^
cc1: all warnings being treated as errorsFixing the code would require either changing the 120 ofending calls to g_object_ref or a refactoring to make all types assignment compatible. Let's take a simpler approach, disabling -Werror, and wait for the next release of ModemManager.
--- package/modem-manager/modem-manager.mk | 6 ++++++ 1 file changed, 6 insertions(+)
package/modem-manager/modem-manager.mk +6 -0
@@ -19,6 +19,12 @@ else MODEM_MANAGER_CONF_OPTS += --without-qmi endif +define MODEM_MANAGER_REMOVE_WERROR + $(SED) 's: -Werror::' $(@D)/configure +endef + +MODEM_MANAGER_POST_PATCH_HOOKS += MODEM_MANAGER_REMOVE_WERROR + ifeq ($(BR2_PACKAGE_MODEM_MANAGER_LIBMBIM),y) MODEM_MANAGER_DEPENDENCIES += libmbim MODEM_MANAGER_CONF_OPTS += --with-mbim
Signature · 1 line
2.17.0
PATCH 1/1 modem-manager: remove -Werror from CFLAGS
Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
We are aproaching the 2018.05 release and modem-manager is still broken due to warnings like this:
mm-base-manager.c: In function 'handle_set_logging':
mm-base-manager.c:680:15: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
ctx-> self = g_object_ref (manager);
Quoted 20 lines
^There is a macro defined in
build/libglib2-2.56.1/gobject/gobject.hwhich leads to the assignment errors:511 /* Make reference APIs type safe with macros */
512 #defineg_object_ref(Obj)((__typeof__(Obj)) (g_object_ref) (Obj))The problem can be easily reproduced with this sample code:
$ cat test.c extern void *g_object_ref(void *); #define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj)) extern double *new_double(int *); double *new_double(int *ip) { double *dp; dp = g_object_ref(ip); return dp; }
Quoted 3 lines
$ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o /tmp/test.c: In function ?new_context?: /tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
ctx-> self = g_object_ref(om);
Quoted 18 lines
^cc1: all warnings being treated as errors
Fixing the code would require either changing the 120 ofending calls to
g_object_refor a refactoring to make all types assignment compatible. Let's take a simpler approach, disabling -Werror, and wait for the next release of ModemManager.Signed-off-by Carlos Santos <[email protected]>--- package/modem-manager/modem-manager.mk | 6 ++++++ 1 file changed, 6 insertions(+)package/modem-manager/modem-manager.mk +0
-0
package/modem-manager/modem-manager.mk else · line 24
Quoted 6 lines
package/modem-manager/modem-manager.mk +3
-0@@ -19,6 +19,12 @@ else MODEM_MANAGER_CONF_OPTS += --without-qmi endif +define MODEM_MANAGER_REMOVE_WERROR + $(SED) 's: -Werror::' $(@D)/configure +endef
-Werror seems to come from m4/compiler_warnings.m4:
AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
Wouldn't passing --disable-more-warnings work instead of hacking up configure?
Signature · 1 line
Bye, Peter Korsgaard
PATCH 1/1 modem-manager: remove -Werror from CFLAGS
Quoted 77 lines
From: "Peter Korsgaard" <[email protected]>
To: "Carlos Santos" <[email protected]>
Cc: "buildroot" <[email protected]>, "Thomas Petazzoni" <[email protected]>, "Aleksander Morgado" <[email protected]>
Sent: Monday, May 21, 2018 12:54:14 PM
Subject: Re: [PATCH] modem-manager: remove -Werror from CFLAGSQuoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
We are aproaching the 2018.05 release and modem-manager is still broken due to warnings like this:
mm-base-manager.c: In function 'handle_set_logging':
mm-base-manager.c:680:15: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]ctx-> self =
g_object_ref(manager);Quoted 20 lines
^There is a macro defined in
build/libglib2-2.56.1/gobject/gobject.hwhich leads to the assignment errors:511 /* Make reference APIs type safe with macros */
512 #defineg_object_ref(Obj)((__typeof__(Obj)) (g_object_ref) (Obj))The problem can be easily reproduced with this sample code:
$ cat test.c extern void *g_object_ref(void *); #define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj)) extern double *new_double(int *); double *new_double(int *ip) { double *dp; dp = g_object_ref(ip); return dp; }Quoted 4 lines
$ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o /tmp/test.c: In function ?new_context?: /tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]ctx-> self =
g_object_ref(om);Quoted 19 lines
^cc1: all warnings being treated as errors
Fixing the code would require either changing the 120 ofending calls to
g_object_refor a refactoring to make all types assignment compatible. Let's take a simpler approach, disabling -Werror, and wait for the next release of ModemManager.Signed-off-by Carlos Santos <[email protected]>--- package/modem-manager/modem-manager.mk | 6 ++++++ 1 file changed, 6 insertions(+)package/modem-manager/modem-manager.mk +0
-0package/modem-manager/modem-manager.mk else · line 24
Quoted 6 lines
package/modem-manager/modem-manager.mk +3
-0@@ -19,6 +19,12 @@ else MODEM_MANAGER_CONF_OPTS += --without-qmi endif +define MODEM_MANAGER_REMOVE_WERROR + $(SED) 's: -Werror::' $(@D)/configure +endef-Werror seems to come from m4/compiler_warnings.m4:
AC_ARG_ENABLE(more-warnings,
AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes)AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
CFLAGS="-Wall -Werror -std=gnu89 $CFLAGS"
Quoted 2 lines
Wouldn't passing --disable-more-warnings work instead of hacking up configure?
Yes, if you don't forget the trailing "s" in --disable-more-warnings, like I did in my first attempt. :-P
I will send an updated patch.
Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D ?Marched towards the enemy, spear upright, armed with the certainty that only the ignorant can have.? ? Epitaph of a volunteer
PATCH 1/1 modem-manager: remove -Werror from CFLAGS
Quoted 7 lines
Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Carlos" == Carlos Santos <[email protected]> writes:
Wouldn't passing --disable-more-warnings work instead of hacking up configure?
Yes, if you don't forget the trailing "s" in --disable-more-warnings, like I did in my first attempt. :-P
heh ;)
Quoted 1 line
I will send an updated patch.
Notice that I already sent such a patch with you in CC:
https://patchwork.ozlabs.org/patch/917852/
Signature · 1 line
Bye, Peter Korsgaard
PATCH v2 1/1 modem-manager: remove -Werror from CFLAGS
In reply to Yegor YefremovWe are aproaching the 2018.05 release and modem-manager is still broken due to warnings like this:
mm-base-manager.c: In function 'handle_set_logging':
mm-base-manager.c:680:15: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
ctx->self = g_object_ref (manager);
^There is a macro defined in build/libglib2-2.56.1/gobject/gobject.h which leads to the assignment errors:
511 /* Make reference APIs type safe with macros */
512 #define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
The problem can be easily reproduced with this sample code:
$ cat test.c
extern void *g_object_ref(void *);
#define g_object_ref(Obj) ((__typeof__(Obj)) (g_object_ref) (Obj))
extern double *new_double(int *);
double *new_double(int *ip) {
double *dp;
dp = g_object_ref(ip);
return dp;
} $ gcc -Wall -Werror -c /tmp/test.c -o /tmp/test.o
/tmp/test.c: In function ?new_context?:
/tmp/test.c:19:13: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types]
ctx->self = g_object_ref(om);
^
cc1: all warnings being treated as errorsFixing the code would require either changing the 120 ofending calls to g_object_ref or a refactoring to make all types assignment compatible. Let's take a simpler approach, disabling extra warnings, and wait for the next release of ModemManager.
--- package/modem-manager/modem-manager.mk | 1 + 1 file changed, 1 insertion(+)
package/modem-manager/modem-manager.mk +1 -0
@@ -11,6 +11,7 @@ MODEM_MANAGER_LICENSE = GPL-2.0+ (programs, plugins), LGPL-2.0+ (libmm-glib) MODEM_MANAGER_LICENSE_FILES = COPYING COPYING.LIB MODEM_MANAGER_DEPENDENCIES = host-pkgconf host-intltool libglib2 libgudev MODEM_MANAGER_INSTALL_STAGING = YES +MODEM_MANAGER_CONF_OPTS = --disable-more-warnings ifeq ($(BR2_PACKAGE_MODEM_MANAGER_LIBQMI),y) MODEM_MANAGER_DEPENDENCIES += libqmi
Signature · 1 line
2.17.0