xref: /csrg-svn/usr.bin/f77/libF77/subout.c (revision 22988)
110547Sdlw /*
2*22988Skre  * Copyright (c) 1980 Regents of the University of California.
3*22988Skre  * All rights reserved.  The Berkeley software License Agreement
4*22988Skre  * specifies the terms and conditions for redistribution.
5*22988Skre  *
6*22988Skre  *	@(#)subout.c	5.1	06/07/85
710547Sdlw  */
810547Sdlw 
910547Sdlw #include <stdio.h>
1010547Sdlw 
1110547Sdlw subout(varn, offset, procn, line)
1210547Sdlw char *varn, *procn;
1310547Sdlw long int offset;
1410547Sdlw int line;
1510547Sdlw {
1610547Sdlw register int i;
1710547Sdlw 
1810547Sdlw fprintf(stderr, "Subscript out of range on line %d of procedure ", line);
1910547Sdlw for(i = 0 ; i < 8 && *procn!='_' ; ++i)
2010547Sdlw 	putc(*procn++, stderr);
2110547Sdlw fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1);
2210547Sdlw for(i = 0 ; i < 6  && *varn!=' ' ; ++i)
2310547Sdlw 	putc(*varn++, stderr);
2410547Sdlw fprintf(stderr, ".\n");
2520187Slibs f77_abort();
2610547Sdlw }
27