public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: David Fernandez <dfernandez@cct.co.uk>
To: Andrew Lunn <andrew@lunn.ch>
Cc: eCos Disuss <ecos-discuss@ecos.sourceware.org>
Subject: Re: [ECOS] Problems building ecos sources
Date: Mon, 27 Feb 2006 22:48:00 -0000	[thread overview]
Message-ID: <1141039571.6090.18.camel@software.cct.co.uk> (raw)
In-Reply-To: <20060227100907.GC18806@lunn.ch>

On Mon, 2006-02-27 at 11:09 +0100, Andrew Lunn wrote:
> On Mon, Feb 27, 2006 at 09:32:59AM +0000, David Fernandez wrote:
> > On Mon, 2006-02-27 at 10:22 +0100, Andrew Lunn wrote:
> > > > 	The problem seems to be in the last line:
> > > > 
> > > >     (_sparg_)      = (CYG_ADDRESS) _regs_;                              \
> > > > 
> > > > 	My gcc version is 4.0.2:
> > > 
> > > That makes sense. Thew macro is being called with:
> > > 
> > > HAL_THREAD_INIT_CONTEXT((CYG_ADDRWORD)workspace_end,
> > >                                         breakpoint, trampoline,0);
> > > 
> > > and (_sparg_) is the first parameter. Edit main.c change the cast to
> > > (CYG_ADDRESS). It might work, or it might still compain about casting
> > > the lvalue....
> > > 
> > >         Andrew
> > 
> > 	Still complaining, same error.
> 
> So it looks like you will have to add a new local variable of type
> CYG_ADDRESS, assign workspace_end to it and then pass the variable to
> the macro.
> 
>         Andrew

	Andrew,

	I think that what you propose is to do:

CYG_ADDRESS workspace_end_int = (CYG_ADDRESS) workspace_end;
HAL_THREAD_INIT_CONTEXT(workspace_end_int,
			breakpoint, trampoline, 0);
workspace_end = (CYG_WORD*)workspace_end_int;

	I propose, to keep the macro useful in saving typing code, and to not
replicate the functionality of the last line of the macro; to change the
macro line:

register CYG_WORD* _sp_ = ((CYG_WORD*)((_sparg_) &~15));

into

register CYG_WORD* _sp_ = ((CYG_WORD*)((CYG_ADDRWORD)(_sparg_) &~15));

and get rid of the casting to (CYG_ADDRWORD) in main.

	I think this makes more sense, you cannot cast something to an int, and
expect to behave as l-value, the macro should receive a variable without
casting. On the other hand, you can always cast a r-value to int if
unsure of getting a real int or a pointer.

	Either way, it fixes the problem, and either make and gmake go well
now.

	Thank you very much Andrew.

David.


-- 
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:[~2006-02-27 11:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 16:49 David Fernandez
2006-02-22 16:54 ` Andrew Lunn
     [not found]   ` <1140627369.2878.18.camel@software.cct.co.uk>
2006-02-22 21:39     ` Andrew Lunn
2006-02-23 11:33       ` David Fernandez
2006-02-23 15:02         ` Andrew Lunn
2006-02-23 15:37           ` David Fernandez
2006-02-23 15:51             ` Andrew Lunn
2006-02-23 16:48             ` [ECOS] " John Dallaway
     [not found]               ` <1140716284.2885.45.camel@software.cct.co.uk>
2006-02-24  6:11                 ` Andrew Lunn
2006-02-24 16:38                   ` David Fernandez
2006-02-24 17:14                     ` Andrew Lunn
2006-02-24 22:00                     ` [ECOS] " David Fernandez
2006-02-26  5:19                       ` Andrew Lunn
2006-02-27 10:09                         ` David Fernandez
2006-02-27 11:25                           ` Andrew Lunn
2006-02-27 15:35                             ` David Fernandez
     [not found]                             ` <1141032779.2878.13.camel@software.cct.co.uk>
2006-02-27 18:14                               ` Andrew Lunn
2006-02-27 22:48                                 ` David Fernandez [this message]
2006-05-14  2:51                                   ` Frank Pagliughi
2006-02-26 23:13                       ` Chuck McManis
2006-02-27  9:33                         ` David Fernandez
2006-02-23 17:30         ` Andrew Lunn

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=1141039571.6090.18.camel@software.cct.co.uk \
    --to=dfernandez@cct.co.uk \
    --cc=andrew@lunn.ch \
    --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).