1 /*- 2 * Copyright (c) 1980 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.proprietary.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)s_rnge.c 5.2 (Berkeley) 04/12/91"; 10 #endif /* not lint */ 11 12 #include <stdio.h> 13 14 /* called when a subscript is out of range */ 15 16 s_rnge(varn, offset, procn, line) 17 char *varn, *procn; 18 long int offset; 19 int line; 20 { 21 register int i; 22 23 fprintf(stderr, "Subscript out of range on file line %d, procedure ", line); 24 for(i = 0 ; i < 8 && *procn!='_' ; ++i) 25 putc(*procn++, stderr); 26 fprintf(stderr, ".\nAttempt to access the %ld-th element of variable ", offset+1); 27 for(i = 0 ; i < 6 && *varn!=' ' ; ++i) 28 putc(*varn++, stderr); 29 fprintf(stderr, ".\n"); 30 f77_abort(); 31 } 32