All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
To: buildroot@busybox.net
Subject: [Buildroot] modem-manager: build issue
Date: Fri, 20 Apr 2018 08:38:13 +0200	[thread overview]
Message-ID: <20180420083813.0a2eac51@windsurf.numericable.fr> (raw)
In-Reply-To: <1847604074.751187.1524194593095.JavaMail.zimbra@datacom.ind.br>

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

  reply	other threads:[~2018-04-20  6:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180420083813.0a2eac51@windsurf.numericable.fr \
    --to=thomas.petazzoni@bootlin.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.