* [Buildroot] modem-manager: build issue
@ 2018-04-18 12:32 Yegor Yefremov
2018-04-18 13:30 ` Thomas Petazzoni
2018-04-18 14:33 ` Carlos Santos
0 siblings, 2 replies; 13+ messages in thread
From: Yegor Yefremov @ 2018-04-18 12:32 UTC (permalink / raw)
To: buildroot
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].
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-18 12:32 [Buildroot] modem-manager: build issue Yegor Yefremov
@ 2018-04-18 13:30 ` Thomas Petazzoni
2018-04-18 13:36 ` Yegor Yefremov
2018-04-18 14:33 ` Carlos Santos
1 sibling, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2018-04-18 13:30 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 18 Apr 2018 14:32:06 +0200, Yegor Yefremov wrote:
> 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].
>
> Any ideas?
Yes:
https://git.buildroot.org/buildroot/commit/?id=f9b6ec3b59746f3eddd387772ad60aa6bc52aa60
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-18 13:30 ` Thomas Petazzoni
@ 2018-04-18 13:36 ` Yegor Yefremov
2018-04-18 13:51 ` Thomas Petazzoni
0 siblings, 1 reply; 13+ messages in thread
From: Yegor Yefremov @ 2018-04-18 13:36 UTC (permalink / raw)
To: buildroot
On Wed, Apr 18, 2018 at 3:30 PM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Wed, 18 Apr 2018 14:32:06 +0200, Yegor Yefremov wrote:
>> 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].
>>
>> 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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-18 13:36 ` Yegor Yefremov
@ 2018-04-18 13:51 ` Thomas Petazzoni
0 siblings, 0 replies; 13+ messages in thread
From: Thomas Petazzoni @ 2018-04-18 13:51 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 18 Apr 2018 15:36:44 +0200, Yegor Yefremov wrote:
> > On Wed, 18 Apr 2018 14:32:06 +0200, Yegor Yefremov wrote:
> >> 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].
> >>
> >> 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
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
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-18 12:32 [Buildroot] modem-manager: build issue Yegor Yefremov
2018-04-18 13:30 ` Thomas Petazzoni
@ 2018-04-18 14:33 ` Carlos Santos
2018-04-20 3:23 ` Carlos Santos
1 sibling, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2018-04-18 14:33 UTC (permalink / raw)
To: buildroot
> From: "Yegor Yefremov" <yegorslists@googlemail.com>
> To: "buildroot" <buildroot@buildroot.org>
> Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>, "Carlos Santos" <casantos@datacom.ind.br>, "Aleksander
> Morgado" <aleksander@aleksander.es>
> Sent: Wednesday, April 18, 2018 9:32:06 AM
> Subject: 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.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
>
> Yegor
I'm quite busy right now but will try to reproduce the error tonight.
--
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-18 14:33 ` Carlos Santos
@ 2018-04-20 3:23 ` Carlos Santos
2018-04-20 6:38 ` Thomas Petazzoni
0 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2018-04-20 3:23 UTC (permalink / raw)
To: buildroot
> From: "Carlos Santos" <casantos@datacom.ind.br>
> To: "Yegor Yefremov" <yegorslists@googlemail.com>
> Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>, "Aleksander Morgado" <aleksander@aleksander.es>,
> "buildroot" <buildroot@buildroot.org>
> Sent: Wednesday, April 18, 2018 11:33:42 AM
> Subject: Re: [Buildroot] modem-manager: build issue
>> From: "Yegor Yefremov" <yegorslists@googlemail.com>
>> To: "buildroot" <buildroot@buildroot.org>
>> Cc: "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>, "Carlos Santos"
>> <casantos@datacom.ind.br>, "Aleksander
>> Morgado" <aleksander@aleksander.es>
>> Sent: Wednesday, April 18, 2018 9:32:06 AM
>> Subject: 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.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
>>
>> 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 errors
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.
--
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-20 3:23 ` Carlos Santos
@ 2018-04-20 6:38 ` Thomas Petazzoni
2018-04-20 7:28 ` Yegor Yefremov
0 siblings, 1 reply; 13+ messages in thread
From: Thomas Petazzoni @ 2018-04-20 6:38 UTC (permalink / raw)
To: buildroot
Hello,
On Fri, 20 Apr 2018 00:23:13 -0300 (BRT), Carlos Santos wrote:
> 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 errors
Thanks for the investigation!
> 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
--
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] modem-manager: build issue
2018-04-20 6:38 ` Thomas Petazzoni
@ 2018-04-20 7:28 ` Yegor Yefremov
2018-05-21 11:45 ` [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS Carlos Santos
2018-05-21 21:17 ` [Buildroot] [PATCH v2] " Carlos Santos
0 siblings, 2 replies; 13+ messages in thread
From: Yegor Yefremov @ 2018-04-20 7:28 UTC (permalink / raw)
To: buildroot
On Fri, Apr 20, 2018 at 8:38 AM, Thomas Petazzoni
<thomas.petazzoni@bootlin.com> wrote:
> Hello,
>
> On Fri, 20 Apr 2018 00:23:13 -0300 (BRT), Carlos Santos wrote:
>
>> 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 errors
>
> Thanks for the investigation!
>
>> 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).
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 gboolean
handle_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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS
2018-04-20 7:28 ` Yegor Yefremov
@ 2018-05-21 11:45 ` Carlos Santos
2018-05-21 15:54 ` Peter Korsgaard
2018-05-21 21:17 ` [Buildroot] [PATCH v2] " Carlos Santos
1 sibling, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2018-05-21 11:45 UTC (permalink / raw)
To: buildroot
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 errors
Fixing 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.
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
package/modem-manager/modem-manager.mk | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/package/modem-manager/modem-manager.mk b/package/modem-manager/modem-manager.mk
index 100c4a2941..ba4711b6c2 100644
--- a/package/modem-manager/modem-manager.mk
+++ b/package/modem-manager/modem-manager.mk
@@ -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
--
2.17.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS
2018-05-21 11:45 ` [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS Carlos Santos
@ 2018-05-21 15:54 ` Peter Korsgaard
2018-05-21 21:13 ` Carlos Santos
0 siblings, 1 reply; 13+ messages in thread
From: Peter Korsgaard @ 2018-05-21 15:54 UTC (permalink / raw)
To: buildroot
>>>>> "Carlos" == Carlos Santos <casantos@datacom.ind.br> 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);
> ^
> 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 errors
> Fixing 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.
> Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> ---
> package/modem-manager/modem-manager.mk | 6 ++++++
> 1 file changed, 6 insertions(+)
> diff --git a/package/modem-manager/modem-manager.mk b/package/modem-manager/modem-manager.mk
> index 100c4a2941..ba4711b6c2 100644
> --- a/package/modem-manager/modem-manager.mk
> +++ b/package/modem-manager/modem-manager.mk
> @@ -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?
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS
2018-05-21 15:54 ` Peter Korsgaard
@ 2018-05-21 21:13 ` Carlos Santos
2018-05-21 21:34 ` Peter Korsgaard
0 siblings, 1 reply; 13+ messages in thread
From: Carlos Santos @ 2018-05-21 21:13 UTC (permalink / raw)
To: buildroot
> From: "Peter Korsgaard" <peter@korsgaard.com>
> To: "Carlos Santos" <casantos@datacom.ind.br>
> Cc: "buildroot" <buildroot@buildroot.org>, "Thomas Petazzoni" <thomas.petazzoni@free-electrons.com>, "Aleksander
> Morgado" <aleksander@aleksander.es>
> Sent: Monday, May 21, 2018 12:54:14 PM
> Subject: Re: [PATCH] modem-manager: remove -Werror from CFLAGS
>>>>>> "Carlos" == Carlos Santos <casantos@datacom.ind.br> 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);
> > ^
>
> > 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 errors
>
> > Fixing 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.
>
> > Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
> > ---
> > package/modem-manager/modem-manager.mk | 6 ++++++
> > 1 file changed, 6 insertions(+)
>
> > diff --git a/package/modem-manager/modem-manager.mk
> > b/package/modem-manager/modem-manager.mk
> > index 100c4a2941..ba4711b6c2 100644
> > --- a/package/modem-manager/modem-manager.mk
> > +++ b/package/modem-manager/modem-manager.mk
> > @@ -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?
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.
--
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
^ permalink raw reply [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH v2] modem-manager: remove -Werror from CFLAGS
2018-04-20 7:28 ` Yegor Yefremov
2018-05-21 11:45 ` [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS Carlos Santos
@ 2018-05-21 21:17 ` Carlos Santos
1 sibling, 0 replies; 13+ messages in thread
From: Carlos Santos @ 2018-05-21 21:17 UTC (permalink / raw)
To: buildroot
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 errors
Fixing 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.
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
---
package/modem-manager/modem-manager.mk | 1 +
1 file changed, 1 insertion(+)
diff --git a/package/modem-manager/modem-manager.mk b/package/modem-manager/modem-manager.mk
index 100c4a2941..fe4a7a95da 100644
--- a/package/modem-manager/modem-manager.mk
+++ b/package/modem-manager/modem-manager.mk
@@ -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
--
2.17.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS
2018-05-21 21:13 ` Carlos Santos
@ 2018-05-21 21:34 ` Peter Korsgaard
0 siblings, 0 replies; 13+ messages in thread
From: Peter Korsgaard @ 2018-05-21 21:34 UTC (permalink / raw)
To: buildroot
>>>>> "Carlos" == Carlos Santos <casantos@datacom.ind.br> 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 ;)
> I will send an updated patch.
Notice that I already sent such a patch with you in CC:
https://patchwork.ozlabs.org/patch/917852/
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2018-05-21 21:34 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-18 12:32 [Buildroot] modem-manager: build issue Yegor Yefremov
2018-04-18 13:30 ` Thomas Petazzoni
2018-04-18 13:36 ` Yegor Yefremov
2018-04-18 13:51 ` Thomas Petazzoni
2018-04-18 14:33 ` Carlos Santos
2018-04-20 3:23 ` Carlos Santos
2018-04-20 6:38 ` Thomas Petazzoni
2018-04-20 7:28 ` Yegor Yefremov
2018-05-21 11:45 ` [Buildroot] [PATCH] modem-manager: remove -Werror from CFLAGS Carlos Santos
2018-05-21 15:54 ` Peter Korsgaard
2018-05-21 21:13 ` Carlos Santos
2018-05-21 21:34 ` Peter Korsgaard
2018-05-21 21:17 ` [Buildroot] [PATCH v2] " Carlos Santos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox