------- Comment #24 from dfranke at gcc dot gnu dot org  2010-05-01 10:24 
-------
(In reply to comment #23)
> are only detected with the -pedantic option.

Or -std=f95; data.c has:
  /* Overwriting an existing initializer is non-standard but usually only
     provokes a warning from other compilers.  */
  [...]
  gfc_notify_std (GFC_STD_GNU, "Extension: re-initialization "
                  "of '%s' at %L", symbol->name, &expr->where);

-pedantic gives a warning, -std=f* an error.


> Now there is something annoying: compiling the above code with -pedantic leads
> to 9 times the same warning:

Since 9 values are consecutively overwritten - however, this can be fixed.


> SUBROUTINE data_init_array_invalid()
>   ! full array initializer, re-initialize (at least) one element
>   integer :: e(3)
>   data       e    / 3*1 /
>   data       e(2) / 2 /
> END SUBROUTINE
> end
> 
> gives only one warning.

Since only one value is overwritten, e(2) - e(1) and e(3) are initialized only
once.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24978

Reply via email to