From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cagney To: Jim Blandy Cc: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: [RFC/RFA] gdb extension for Harvard architectures Date: Wed, 03 Oct 2001 12:22:00 -0000 Message-id: <3BBB6549.2050803@cygnus.com> References: <3BB4D843.A92818B9@cygnus.com> <3BB512A9.6050801@cygnus.com> <3BB5195F.6050603@cygnus.com> <3BBA2DC9.5060500@cygnus.com> <3BBA3B03.B864ABE0@cygnus.com> <3BBA54AE.3080104@cygnus.com> X-SW-Source: 2001-10/msg00058.html > - If an expression E has some type T, then &E has type T *. To be pedantic: An expression E has some type T, then &E has type T *@data. It is defining a pointer from data space to either code or data space. > This is a fundamental operation, and choosing the wrong behavior here > will inevitably cause troubles elsewhere, too. > > Suppose you attach the qualifier to the pointer, and not the pointee. > That is, `@code' may only be applied to pointer types, and it means > that the pointer points to something in code space. Sorry, you've lost me. What is being discussed is the cast operator and its semantics. A cast takes a type and expression parameter and returns an expression. To the best of my knowledge, ISO C says nothing about cast operations that convert between code and data pointers. What we do have is a certain level of accepted behavour. For instance on a unified byte addressable address space architecture things like: sizeof(void*) == sizeof((*)()) ((*)()) (void*) foo == ((*)()) foo However, on a harvard address space architecture we have none of that. Andrew