[3194] in Athena Bugs
Saber msg: v2.1 (5/10/89) (vulcan) (ibmrt) (Unix) (4042)
daemon@ATHENA.MIT.EDU (jik@ATHENA.MIT.EDU)
Thu Sep 14 03:12:30 1989
From: <jik@ATHENA.MIT.EDU>
Date: Thu, 14 Sep 89 03:12:08 -0400
To: bugs@ATHENA.MIT.EDU
When I load a file with a static procedure in it, I am told that the
procedure is never used:
"shell_regexp.c":43, Unused static variable (Warning #287)
42:
* 43: static int real_cmp(pattern, filename)
44: char *pattern, *filename;
Static function '.real_cmp' was not used.
However, I know that the procedure is, indeed, used when the program
is run. Like so:
5 -> stop real_cmp
stop (1) set at "shell_regexp.c":46, real_cmp().
6 -> run foo
Linking from '/usr/athena/lib/libcom_err.a' ... Linking completed.
Linking from '/lib/libc.a' ..................... Linking completed.
Executing: undelete foo
Stopped in real_cmp(pattern = (char *) 0x1013e01c "foo", filename = (char *) 0x1
0142828 "delete_errs.h") at "shell_regexp.c":46
45: {
B* 46: if (*pattern == '\0') {
47: if (*filename == '\0')
Here's my stack trace at that point:
(break 1) 11 -> where
stop #1 set in
real_cmp(pattern = (char *) 0x1013e01c "foo", filename = (char *) 0x10142828 "delete_errs.h") at "shell_regexp.c":46
reg_cmp(pattern = (char *) 0x1013e01c "foo", filename = (char *) 0x10142828 "delete_errs.h") at "shell_regexp.c":40
find_matches(base = (char *) 0x101102e0 "", expression = (char *) 0x10111cd9 "foo", num_found = (int *) 0x1005e104, found = (char ***) 0x1005e100) at "pattern.c":235
get_the_files(base = (char *) 0x101102e0 "", reg_exp = (char *) 0x10111cd9 "foo", num_found = (int *) 0x1009ac98, found = (char ***) 0x1009ac94) at "undelete.c":596
undelete(file_exp = (char *) 0x10111cd9 "foo") at "undelete.c":178
main(argc = (int) 2, argv = (char **) 0x10111cf0) at "undelete.c":100
saber_run((char *) 0x2) builtin saber function
In fact, this seems to happen every time I use static procedures,
although I'm not sure about that. It does happen pretty often.
Source files to demonstrate this are available upon request.
Jonathan Kamens USnail:
MIT Project Athena 11 Ashford Terrace
jik@Athena.MIT.EDU Allston, MA 02134
Office: 617-253-4261 Home: 617-782-0710