From: Stephen Hemminger <shemminger@vyatta.com>
To: Manish Talreja <mtalreja@crestron.com>
Cc: "bridge@lists.linux-foundation.org" <bridge@lists.linux-foundation.org>
Subject: Re: [Bridge] Update to RSTP lib
Date: Mon, 12 Jan 2009 13:32:02 -0800 [thread overview]
Message-ID: <20090112133202.24eb9a08@extreme> (raw)
In-Reply-To: <EFD19D326CC92D43B5DDDE7431FBD8414C24F9DB8D@MAILCCR1.CRESTRON.CRESTRON.COM>
On Mon, 12 Jan 2009 15:42:11 -0500
Manish Talreja <mtalreja@crestron.com> wrote:
> Here are the unified diff files as requested.
>
> You are right about #pragma pack(). That's supported on pretty much all compilers. However, __attribute__ is not supported on all compilers and that's what was used in the original code. Our goal was to leave the gcc syntax the way it was in the original code. If you are ok with getting rid of the __attribute__((packed)), the code will be a lot more readable.
>
> -Manish
>
>
> -----Original Message-----
> From: richardvoigt@gmail.com [mailto:richardvoigt@gmail.com]
> Sent: Monday, January 12, 2009 3:01 PM
> To: Manish Talreja
> Cc: bridge@lists.linux-foundation.org
> Subject: Re: [Bridge] Update to RSTP lib
>
> If you want your patch to be understandable, create it as a contextual
> diff with the -u option.
>
> Do the pack pragmas really need to be conditional? Pretty much every
> compiler will do the right thing on encountering those. (Using
> __attribute__ as well, for compilers that support it, isn't a bad
> thing but no need to avoid #pragma pack on gcc).
>
> On Mon, Jan 12, 2009 at 1:22 PM, Manish Talreja <mtalreja@crestron.com> wrote:
> > We have been using the RSTP implementation posted at this location:
> >
> > https://lists.linux-foundation.org/pipermail/bridge/2008-May/005859.html
> >
> >
> >
> > We have modified rstp.c and rstp.h to work with compilers other than gcc.
> > Attached are two patch files that show our changes. Currently, we have
> > tested this code with the Diab compiler (v 4.4a) and with IAR compiler (v
> > 5.11).
> >
I would rather the code be cleaned out of the ugly macro's ifdef's.
Also only use pack if necessary (ie unaligned struct like:
struct {
char a;
unsigned b;
};
If all fields are correct types to be naturally packed, then pack
is unnecessary. Compiler's aren't smart enough to recognize this
and assume misalignment so they will generate bloated code for anything
with #pragma pack
next prev parent reply other threads:[~2009-01-12 21:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-12 19:22 [Bridge] Update to RSTP lib Manish Talreja
2009-01-12 20:00 ` richardvoigt
2009-01-12 20:42 ` Manish Talreja
2009-01-12 21:32 ` Stephen Hemminger [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-12-21 16:31 Christopher Merck
2012-12-28 13:47 Christopher Merck
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=20090112133202.24eb9a08@extreme \
--to=shemminger@vyatta.com \
--cc=bridge@lists.linux-foundation.org \
--cc=mtalreja@crestron.com \
/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