* Serious p2c bug with Linux
@ 1993-07-10 19:09 Thomas Koenig
0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 1993-07-10 19:09 UTC (permalink / raw)
There is a serious bug in the p2c that is currently distributed with
SLS, which has cost a co - worker of mine a few, confusing days. In
short, p2c does not do multiplications with numbers in the format 1.0E3.
Converting them to the equivalent 1000. works.
If you convert old PC code to Linux, beware of this.
Here's a short session, which reproduces the bug.
/usr/home/t-rex> cat > hello.p
program hello;
var a: real;
begin
readln(a);
writeln(a*1.0E3);
end.
/usr/home/t-rex> p2c hello.p
hello
Translation completed.
/usr/home/t-rex> cat hello.c
/* Output from p2c, the Pascal-to-C translator */
/* From input file "hello.p" */
#include <p2c/p2c.h>
main(argc, argv)
int argc;
Char *argv[];
{
double a;
PASCAL_MAIN(argc, argv);
scanf("%lg%*[^\n]", &a);
getchar();
printf("% .5E\n", a);
exit(EXIT_SUCCESS);
}
/* End. */
/usr/home/t-rex> cc hello.c -lp2c
/usr/home/t-rex> a.out
10
1.00000E+01
/usr/home/t-rex> exit
--
Thomas Koenig, ig25@rz.uni-karlsruhe.de, ig25@dkauni2.bitnet
The joy of engineering is to find a straight line on a double
logarithmic diagram.
--
Send submissions for comp.os.linux.announce to: linux-announce@tc.cornell.edu
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1993-07-10 19:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1993-07-10 19:09 Serious p2c bug with Linux Thomas Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox