This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Fwd: Re: [ECOS] Problems building ecos sources]


	Hi guys,

	I think this was a previous disscussion in ecos-discuss list, messages:
        34306 by: Andrew Lunn <andrew@lunn.ch>
        34307 by: David Fernandez <dfernandez@cct.co.uk>
        34308 by: Andrew Lunn <andrew@lunn.ch>
        34309 by: David Fernandez <dfernandez@cct.co.uk>

	In the last message you can see both possible solutions.

	I thought somebody had fixed this ... :-)

David Fernandez

--- Begin Message ---
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.


--- End Message ---

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]