[comp.unix.xenix] Bug in rcc

ohl@kivax.UUCP (Ohlhausen Abt.013.4) (02/08/90)

I found a bug in rcc (AT&T C-compiler in SCO Unix V.3.2/386) which occurs when
using floating point constants with significant digits after the decimal point:

	float f;
	f = 0.1;
	printf("f = %f\n",f);

Output is: f = 1.000000

The bug is not in printf(), it's the assignment that goes wrong! Is there
already a fixed rcc out there? I can't believe that nobody found this 
terrible error yet. I've read this group for quite a while but didn't see
any mention about this.


--
Ralf Ohlhausen                     In all probability it's my opinion only!
Mannesmann Kienzle GmbH            ohl@kivax.uucp
7730 VS-Villingen                  Europe: ..!mcvax!unido!kivax!ohl
FRG                                USA:    ..!uunet!unido!kivax!ohl

wsinpdb@eutws1.win.tue.nl (Paul de Bra) (02/09/90)

In article <590@kivax.UUCP> ohl@kivax.UUCP (Ohlhausen Abt.013.4) writes:
>I found a bug in rcc (AT&T C-compiler in SCO Unix V.3.2/386) which occurs when
>using floating point constants with significant digits after the decimal point:

>	float f;
>	f = 0.1;
>	printf("f = %f\n",f);

>Output is: f = 1.000000

This is an SCO feature :-) as it does not occur with the AT&T C-compiler
in AT&T Unix V.3.2/386.

Or else it is a feature of the 80387 emulator if you don't have the
coprocessor (you didn't say, but you should, whenever you mention a
floating point problem, as the emulator is known to be buggy).

Paul.
(debra@research.att.com)

ohl@kivax.UUCP (Ralf Ohlhausen) (02/12/90)

In article <590@kivax.UUCP>, ohl@kivax.UUCP (Ohlhausen Abt.013.4) writes:
> I found a bug in rcc (AT&T C-compiler in SCO Unix V.3.2/386) which occurs when
> using floating point constants with significant digits after the decimal point:
> 
> 	float f;
> 	f = 0.1;
> 	printf("f = %f\n",f);
> 
> Output is: f = 1.000000

In the meantime I found out that the bug occurs only if the environment variable
LANG is set to german_germany.8859 during the compilation. Poor German :-( .
BTW: Greetings to the french_france.8859 people. You have the same problem! :-)
Since the assembler code - produced with the -S option - shows no difference, I
believe that he's the one who doesn't like my language.

-- 
--
Ralf Ohlhausen          * e-mail: ohl@kivax.uucp           * In all probability
Mannesmann Kienzle GmbH * Europe: ..!mcvax!unido!kivax!ohl * this is once again
7730 VS-Villingen  FRG  * USA:    ..!uunet!unido!kivax!ohl * only my opinion !