Open Source Telephony
 help / color / mirror / Atom feed
From: =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont <remi@remlab.net>
To: ofono@ofono.org
Subject: Re: netlink.c:97: error: cast increases required alignment of target type
Date: Mon, 09 Nov 2009 19:45:53 +0200	[thread overview]
Message-ID: <200911091945.53723.remi@remlab.net> (raw)
In-Reply-To: <fb249edb0911090934p7c1f693ag62abda1d84999430@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1569 bytes --]

Le lundi 9 novembre 2009 19:34:36 andrzej zaborowski, vous avez écrit :
> 2009/11/9 Rémi Denis-Courmont <remi@remlab.net>:
> > Le lundi 9 novembre 2009 17:45:25 andrzej zaborowski, vous avez écrit :
> >> Hi,
> >> resurrecting this thread because I think there's no reason ofono
> >> should not build on cpus with strict alignment rules, the netlink code
> >> is actually aligned correctly.  These warnings are a result of
> >> -Wcast-align, the compiler can't know that the casts in the macros are
> >> safe, but they obviously are if you look at the arithmetics there.  In
> >> the case of the netlink warnings they can be turned off for all users
> >> of <linux/netlink.h> using a pragma or only for this cast by casting
> >> to void * first (the only way according to gcc people), the first
> >> attached file adds them (against linux), I'll send it to linux if
> >> there's no better idea.  There are also similar warnings when casting
> >> struct sockaddr_pn * to struct sockaddr * and these can be worked
> >> around in ofono, see second patch, but probably should also be in
> >> linux's include/linux/phonet.h instead.
> >
> > Why do you change the sockaddr_pn type name?!
> 
> Because it's been defined without explicit alignment and I don't think
> you can redefine it with the same name?

As far as I know NO extra alignement is needed. The kernel will anyway memory 
copy from/to the sockaddr_pn buffer as part of the socket calls, so it 
couldn't care less about alignment.

-- 
Rémi Denis-Courmont
http://www.remlab.net/

  reply	other threads:[~2009-11-09 17:45 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-09 15:45 netlink.c:97: error: cast increases required alignment of target type andrzej zaborowski
2009-11-09 17:27 ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
2009-11-09 17:34   ` andrzej zaborowski
2009-11-09 17:45     ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont [this message]
2009-11-09 17:57       ` andrzej zaborowski
2009-11-09 18:03         ` =?unknown-8bit?q?R=C3=A9mi?= Denis-Courmont
  -- strict thread matches above, loose matches on Subject: below --
2009-09-15 18:36 Timo Juhani Lindfors
2009-09-16 14:00 ` Aki Niemi

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=200911091945.53723.remi@remlab.net \
    --to=remi@remlab.net \
    --cc=ofono@ofono.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox