Patch for PR 9255
[official-gcc.git] / libf2c / libF77 / s_rnge.c
blob6c054c707f56bd4eada8f1cf574b05ffccd55c50
1 #include <stdio.h>
2 #include "f2c.h"
4 /* called when a subscript is out of range */
6 extern void sig_die (char *, int);
7 integer
8 s_rnge (char *varn, ftnint offset, char *procn, ftnint line)
10 register int i;
12 fprintf (stderr, "Subscript out of range on file line %ld, procedure ",
13 (long) line);
14 while ((i = *procn) && i != '_' && i != ' ')
15 putc (*procn++, stderr);
16 fprintf (stderr, ".\nAttempt to access the %ld-th element of variable ",
17 (long) offset + 1);
18 while ((i = *varn) && i != ' ')
19 putc (*varn++, stderr);
20 sig_die (".", 1);
21 return 0; /* not reached */