[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc-fortran
Subject:    Re: [Patch, fortran] PR44354 implied-do-loop array constructors using the induction variable in the
From:       Mikael Morin <mikael.morin () sfr ! fr>
Date:       2012-07-23 18:53:37
Message-ID: 500D9DB1.8090204 () sfr ! fr
[Download RAW message or body]

On 23/07/2012 07:58, Tobias Burnus wrote:
> Mikael Morin wrote:
>> Here is another attempt.
>> I moved the diagnostic code from gfc_resolve_iterator to
>> resolve_array_list, so that it doesn't trigger for do loops.
>> Regression test in progress. OK?
> 
> The patch looks OK:
> 
> Though, I wonder why you only get a warning (which is fine); I thought
> that -std=gnu (the default) – and, in particular, in combination with
> -pedantic (test-suite default) – will give an error for
> gfc_notify_standard, not a warning.
> 
Well, no; it passed the test-suite. :-)

options.c's set_default_std_flags explicitely allows legacy stuff:

static void
set_default_std_flags (void)
{
  gfc_option.allow_std = GFC_STD_F95_OBS | GFC_STD_F95_DEL
    | GFC_STD_F2003 | GFC_STD_F2008 | GFC_STD_F95 | GFC_STD_F77
    | GFC_STD_F2008_OBS | GFC_STD_F2008_TS | GFC_STD_GNU | GFC_STD_LEGACY;
  gfc_option.warn_std = GFC_STD_F95_DEL | GFC_STD_LEGACY;
}


and the references to pedantic in options.c only increase warnings (see
gfc_post_options):

  /* If -pedantic, warn about the use of GNU extensions.  */
  if (pedantic && (gfc_option.allow_std & GFC_STD_GNU) != 0)
    gfc_option.warn_std |= GFC_STD_GNU;
  /* -std=legacy -pedantic is effectively -std=gnu.  */
  if (pedantic && (gfc_option.allow_std & GFC_STD_LEGACY) != 0)
    gfc_option.warn_std |= GFC_STD_F95_OBS | GFC_STD_F95_DEL |
GFC_STD_LEGACY;


Thanks for the review.

Mikael
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic