This is the mail archive of the gcc-patches@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: [FORTRAN PATCH] Fix type punning problem in mio_array_ref


On Sat, Jan 20, 2007 at 10:14:39AM -0700, Roger Sayle wrote:
> 
> 2007-01-20  Roger Sayle  <roger@eyesopen.com>
> 
>         * module.c (mio_array_ref): The dimen_type fields of an array ref
>         are an enumerated type and can't be read/written directly with a
>         call to mio_integer.  Instead loop over and cast each element.
> 

OK, with one comment below.

> !   /* This is equivalent to "mio_integer ((int *) &ar->dimen_type[i]);".  */

3 years from now someone might see this comment and change everything
back.  Can you expand the comment to include a statement about the
type punning problem of the enumerated type?

> !   if (iomode == IO_OUTPUT)
> !     {
> !       for (i = 0; i < ar->dimen; i++)


-- 
Steve


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