This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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: does gcc support multiple sizes, or not?


DJ Delorie wrote:

> The problem seems to revolve around casts.  How about if I turn the
> abort into a useful message about casting between pointer sizes, and
> require the user to use a builtin to convert pointers? 

That's a good start -- but, at the very least, you still have to say
what happens for type_info and define name-mangling.

Your suggestion isn't going to be easy to implement, either; the front
end probably has lots of places where it handles, for example, implicit
conversions from Derived* to Base*, and it's going to be looking at the
types of the pointed-to objects, but all it's going to check for the
pointer types is that they are in fact POINTER_TYPE nodes.

I think you really have to accept that the change you want to make goes
to a relatively fundamental invariant of C++.  It's not something you
can do correctly as a quick change; you have to think through all the
consequences.

I'll again point out that in your reset-vector example you don't
actually need any pointer operations.  You could just as well do:

  typedef int ifunc __attribute__((mode(SI));
  vects[A0_VEC] = __builtin_pointer32 (timer_a0_handler);

I think you should consider that solution.  It's not as pretty, for the
programmer, but it's a lot less problematic from a language point of view.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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