Thread View: mod.computers.pyramid
1 messages
1 total messages
Started by brahms
Fri, 01 Aug 1986 22:48
another c bug?
Author: brahms
Date: Fri, 01 Aug 1986 22:48
Date: Fri, 01 Aug 1986 22:48
77 lines
2488 bytes
2488 bytes
The following problem came up while I was trying to compile larn on a
pyramid. I'm curious to know if it is a bug with the Pyramid C compiler
or something that just happens to work on a number of other machines but
not the Pyramid? It appears that the called procedure writes information
on what is believes is the top of the stack. Anyway, to get around it, I
modifed lprintf from larn to included extra arguments such as in
five_int_args below.
Script started on Fri Aug 1 15:39:12 1986
demo: cat t.c
#include <stdio.h>
five_int_args (args, a, b, c, d)
int args, a, b, c, d;
{
int *pargs;
int i;
pargs = &args;
while (*pargs != 0)
printf ("%d : ", *pargs++);
printf ("%d\n", 0);
}
show_int_args (args)
int args;
{
int *pargs;
int i;
pargs = &args;
while (*pargs != 0)
printf ("%d : ", *pargs++);
printf ("%d\n", 0);
}
main()
{
show_int_args (0);
show_int_args (1, 0);
show_int_args (1, 2, 0);
show_int_args (1, 2, 3, 0);
show_int_args (1, 2, 3, 4, 0);
show_int_args (1, 2, 3, 4, 5, 0);
five_int_args (1, 2, 3, 4, 0);
}
demo: cc -o t t.c
demo: t
0
1 : 0
1 : 2 : -1072901880 : 320 : 12 : -1072902016 : 0
1 : 2 : -1072901880 : 0
1 : 2 : -1072901880 : 4 : 0
1 : 2 : -1072901880 : 4 : 5 : 0
1 : 2 : 3 : 4 : 0
demo: what /lib/ccom
/lib/ccom
CCOMP_3.1.9 Mar 19 16:50:26 1986
yaccpar 4.1 (Berkeley) 2/11/83
FLUSH.c 1.2 6/10/81
NEW.c 1.3 6/10/81
UNIT.c 1.2 6/10/81
WRITLN.c 1.2 6/10/81
ERROR.c 1.10 1/10/83
PCEXIT.c 1.1 10/30/80
PCLOSE.c 1.6 1/21/83
PCSTART.c 1.8 1/10/83
PFCLOSE.c 1.3 (Berkeley) 1/21/83
PERROR.c 1.2 1/10/83
PFLUSH.c 1.2 1/21/83
EXCEPT.c 1.3 1/10/83
malloc.c 4.3 (Berkeley) 9/16/83
script done on Fri Aug 1 15:40:23 1986
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads