public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Alexander Neundorf <neundorf@kde.org>
To: ecos-discuss@ecos.sourceware.org
Subject: Re: [ECOS] RE: Byte array address alignment
Date: Wed, 26 Oct 2005 16:23:00 -0000	[thread overview]
Message-ID: <200510261823.23059.neundorf@kde.org> (raw)
In-Reply-To: <435F2299.2020808@cetoni.de>

On Wednesday 26 October 2005 08:30, Uwe Kindler wrote:
> Hello,
>
> not all compilers align byte arrays to a 4 byte boundary on a 32 bit
> machine or to a 2 byte boundary on a 16 bit machine. Even the GNU
> comiler does not follow these alignment rules for all machines. For
> example the h8300-elf toolchain does not align byte arrays and this is a
> big problem for eCos development because the eCos source code contains a
> number of byte arrays (i.e. the idle thread stack) that are expected to
> be aligned. In my opinion, if a certain alignment of arrays is required
> it should be explicit declared by using another data type (i.e. short or
> long).

Or even better and more explicit:
char buf[1024] __attribute__ ((aligned(4))); //or whatever alignment you need
This also doesn't require changing the type.

Bye
Alex
-- 
Work: alexander.neundorf@jenoptik.com - http://www.jenoptik-los.de
Home: neundorf@kde.org                - http://www.kde.org
      alex@neundorf.net               - http://www.neundorf.net

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

      reply	other threads:[~2005-10-26 16:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-26  6:31 Uwe Kindler
2005-10-26 16:23 ` Alexander Neundorf [this message]

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=200510261823.23059.neundorf@kde.org \
    --to=neundorf@kde.org \
    --cc=ecos-discuss@ecos.sourceware.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 read-only IMAP folder(s) and NNTP newsgroup(s).