xref: /csrg-svn/usr.bin/f77/libF77/subout.c (revision 10547)
1*10547Sdlw /*
2*10547Sdlw  *	"@(#)subout.c	1.1"
3*10547Sdlw  */
4*10547Sdlw 
5*10547Sdlw #include <stdio.h>
6*10547Sdlw 
7*10547Sdlw subout(varn, offset, procn, line)
8*10547Sdlw char *varn, *procn;
9*10547Sdlw long int offset;
10*10547Sdlw int line;
11*10547Sdlw {
12*10547Sdlw register int i;
13*10547Sdlw 
14*10547Sdlw fprintf(stderr, "Subscript out of range on line %d of procedure ", line);
15*10547Sdlw for(i = 0 ; i < 8 && *procn!='_' ; ++i)
16*10547Sdlw 	putc(*procn++, stderr);
17*10547Sdlw fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1);
18*10547Sdlw for(i = 0 ; i < 6  && *varn!=' ' ; ++i)
19*10547Sdlw 	putc(*varn++, stderr);
20*10547Sdlw fprintf(stderr, ".\n");
21*10547Sdlw _cleanup();
22*10547Sdlw abort();
23*10547Sdlw }
24