This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

RE: Address assignment


----Original Message----
>From: Paul Koning
>Sent: 14 September 2005 20:23

>>>>>> "Dave" == Dave Korn <dave.korn@artimi.com> writes:
> 
>  >> Why add an unneeded level of indirection?  Especially on
>  >> time-critical embedded systems?
> 
>  Dave> These days, I really have *lots* of faith in the compiler to be
>  Dave> able to optimise that away[*].  But I guess you could always
>  Dave> write
> 
>  Dave> #define my_struct (*(struct my_struct_type *)0xa0001028)
> 
>  Dave> and treat it just like an object
> 
>  Dave> my_struct.x = 3;
> 
> If you don't want accesses optimized away, you need "volatile".
> 
>    paul


  You've missed the point.  I _do_ want accesses optimised away.  Accesses
to the pointer variable; not accesses to the thing it points at.  Yes, for
most memory-mapped h/w, you would want the object to be volatile.  But you
and I are talking about things on opposite sides of the '*':

volatile my_struct_type * const my_struct_ptr = blablablaaaa;



    cheers,
      DaveK
-- 
Can't think of a witty .sigline today....


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