[6854] in Athena Bugs
decmips 7.2P: /usr/bin/pic
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Jan 9 17:04:58 1991
Date: Wed, 9 Jan 91 17:04:49 EST
From: John T Kohl <jtkohl@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
System name: quicksilver
Type and version: KN01 7.2P
Display type: PM-MONO
What were you trying to do?
debug pic
What's wrong:
It had some bugs dealing with passing floating point values to
functions which were expecting a union which has a float in it.
It also mis-declared atof().
What should have happened:
It should have worked. Here are some patches (the yacc output
must be post-processed on the MIPS to make the floating-point passing
conventions work right).
Here are some diffs:
diff -rcbw /source/third/common/ditroff/pic/Makefile ./Makefile
*** /source/third/common/ditroff/pic/Makefile Sun Jul 15 19:21:13 1990
--- ./Makefile Wed Jan 9 16:45:29 1991
***************
*** 40,45 ****
--- 40,52 ----
y.tab.h: picy.o
+ picy.c: picy.y
+
+ picy.o:
+ $(YACC) $(YFLAGS) picy.y
+ sed -f sed_ytabc <y.tab.c >picy.c
+ $(CC) $(CFLAGS) -c picy.c
+
pic.ydef: y.tab.h
-cmp -s y.tab.h pic.ydef || cp y.tab.h pic.ydef
diff -rcbw /source/third/common/ditroff/pic/driver.c ./driver.c
*** /source/third/common/ditroff/pic/driver.c Wed Jan 8 15:57:27 1986
--- ./driver.c Wed Jan 9 16:24:42 1991
***************
*** 1,5 ****
--- 1,6 ----
#include <stdio.h>
#include <ctype.h>
+ #include <math.h>
#define DEV202 1
#define DEVAPS 2
***************
*** 37,43 ****
main(argc,argv)
char **argv;
{
- float atof();
int c;
cmdname = argv[0];
--- 38,43 ----
diff -rcbw /source/third/common/ditroff/pic/pic.h ./pic.h
*** /source/third/common/ditroff/pic/pic.h Wed Jan 8 15:57:31 1986
--- ./pic.h Wed Jan 9 16:25:17 1991
***************
*** 126,129 ****
extern int nstack;
extern int cw;
! extern float atof();
--- 126,129 ----
extern int nstack;
extern int cw;
! #include <math.h>
diff -rcbw /source/third/common/ditroff/pic/picl.l ./picl.l
*** /source/third/common/ditroff/pic/picl.l Wed Jan 8 15:57:32 1986
--- ./picl.l Wed Jan 9 16:25:33 1991
***************
*** 14,20 ****
#include "pic.h"
#include "y.tab.h"
- extern float atof();
extern struct symtab symtab[];
extern char *filename;
extern int synerr;
--- 14,19 ----
*** /dev/null Wed Jan 9 16:47:17 1991
--- ./sed_ytabc Wed Jan 9 16:46:06 1991
***************
*** 0 ****
--- 1,5 ----
+ /makeattr/ s/\.f//g
+ /makeattr/ s/\.o//g
+ /makevar/ s/\.i/\.p/g
+ /makevar/ s/\.f//g
+
Please describe any relevant documentation references:
pic(1), atof(3)