netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: dlstevens@us.ibm.com
Cc: netdev@vger.kernel.org, netdev-owner@vger.kernel.org,
	yoshfuji@linux-ipv6.org
Subject: Re: [GIT PULL] [IPV6] COMPAT: Fix SSM applications on 64bit kernels.
Date: Sat, 26 Apr 2008 00:09:44 -0700 (PDT)	[thread overview]
Message-ID: <20080426.000944.50852302.davem@davemloft.net> (raw)
In-Reply-To: <OF7B59958D.88AA9A1D-ON88257437.0023AEDC-88257437.00268638@us.ibm.com>

From: David Stevens <dlstevens@us.ibm.com>
Date: Sat, 26 Apr 2008 00:00:49 -0700

>         I did see that plain old structure field __attribute((4))__
> wasn't correct (still padded), and gcc docs use the same language
> to define the behavior for structure field attribute "aligned" and
> type attribute "aligned" (at least with my limited research). So,
> it surprised me that the field attribute results in pad and the
> type attribute doesn't, and I wonder if it's good to rely on that
> difference given the same documentation for both as "minimum alignment".
> But if the compiler changes its notion of when to pad this in a way
> that breaks it, we can always revisit it later. :-)

You're right about this point of course:

--------------------
struct foo {
	int a;
	unsigned long b;
};

struct foo_align4 {
	int a;
	unsigned long b;
} __attribute__((aligned(4)));

int main(void)
{
	printf("Normal: 'b' offset is %Zu\n",
	       __builtin_offsetof(struct foo, b));
	printf("Align4: 'b' offset is %Zu\n",
	       __builtin_offsetof(struct foo_align4, b));
	return 0;
}
--------------------

gives:

--------------------
Normal: 'b' offset is 8
Align4: 'b' offset is 8
--------------------

on sparc64.

So if we need to use packed because of that specific problem here,
fine.

  reply	other threads:[~2008-04-26  7:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-24  8:02 [GIT PULL] [IPV6] COMPAT: Fix SSM applications on 64bit kernels YOSHIFUJI Hideaki / 吉藤英明
2008-04-24  8:08 ` David Miller
2008-04-24  8:16   ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-24  8:49     ` David Miller
2008-04-24  9:28       ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-24  9:35         ` David Miller
2008-04-24 18:46     ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-24 20:01       ` David Stevens
2008-04-24 20:43         ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-24 20:59           ` David Stevens
2008-04-24 17:52 ` David Stevens
2008-04-25  5:38   ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-25  6:23     ` David Stevens
2008-04-25  6:27       ` David Miller
2008-04-25  6:31   ` David Miller
2008-04-25  6:37     ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-25  6:47       ` David Miller
2008-04-25  6:59         ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-25  7:04           ` David Miller
2008-04-25  7:24             ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-26  0:24               ` David Stevens
2008-04-26  3:33                 ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-26  4:36                   ` David Stevens
2008-04-26  4:53                     ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-26  5:32                       ` David Miller
2008-04-26  5:56                         ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-26  6:01                           ` David Miller
2008-04-26  6:25                             ` David Stevens
2008-04-26  6:31                               ` David Miller
2008-04-26  7:13                                 ` David Stevens
2008-04-26  9:07                                   ` David Miller
2008-04-26  5:09                     ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-26  5:31                     ` David Miller
2008-04-26  7:00                       ` David Stevens
2008-04-26  7:09                         ` David Miller [this message]
2008-04-26 23:55                   ` David Stevens
2008-04-27  8:06                     ` David Miller
2008-04-26  5:14                 ` YOSHIFUJI Hideaki / 吉藤英明
2008-04-26  5:33                   ` David Miller

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=20080426.000944.50852302.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=dlstevens@us.ibm.com \
    --cc=netdev-owner@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.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;
as well as URLs for NNTP newsgroup(s).