[patch, fortran] PR46079 ABI for empty stop statement broken

Mikael Morin mikael.morin@sfr.fr
Wed Oct 20 21:40:00 GMT 2010


On Wednesday 20 October 2010 06:22:56 Jerry DeLisle wrote:
> Attached is a revised patch.  
> [...]
> Regression tested.  OK for trunk?
OK with...

> 
> newstop.diff
>   Index: libgfortran/runtime/stop.c
> ===================================================================
> --- libgfortran/runtime/stop.c  (revision 165674)
> +++ libgfortran/runtime/stop.c  (working copy)
> @@ -35,6 +35,22 @@ export_proto(stop_numeric);
>  void
>  stop_numeric (GFC_INTEGER_4 code)
>  {
> +  if (code == -1)
> +    code = 0;
> +  else
> +    st_printf ("STOP %d\n", (int)code);
> +
> +  sys_exit (code);
> +}

... some vertical space here.

> +/* A Fortran 2008 numeric STOP statement.  */
> +
> +extern void stop_numeric_f08 (GFC_INTEGER_4)
> +  __attribute__ ((noreturn));
> +export_proto(stop_numeric_f08);
> +
> +void
> +stop_numeric_f08 (GFC_INTEGER_4 code)
> +{
>    st_printf ("STOP %d\n", (int)code);
>    sys_exit (code);
>  }

Thanks!

Mikael

PS: Bonus point if you add a mention on the wiki to eventually rename 
stop_numeric_f08 back to stop_numeric. :-)





More information about the Fortran mailing list