This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Compiler Bug
- To: bug-gcc at gnu dot org
- Subject: Re: Compiler Bug
- From: "Edmund Witkowski" <edwitkowski at hotmail dot com>
- Date: Sun, 05 Mar 2000 18:32:38 PST
I have found a bug within the compiler but do not know how to
fix it.
I have written a program for the PalmIII and compiled it with the
older compiler back in November of 1999. Both the compiler
and the program worked great.
I installed the latest GCC compiler and recompiled:
1) I had to make adjustments to the HEADER-Files in my 'C' program
2) I had to make adjustments to my DOS-BATCH file (I don't use MAKE
files) and that worked
So far so good.
But when I compiled (and it compiled successfully) the program
was running but the calculations in the program were WRONG?
I checked the CAST ability, from LONG to DOUBLE and from DOUBLE to
LONG. Seems to work.
But when I converted a STRING to a LONG to a DOUBLE to a LONG to
a STRING the program LOCKED? But the SAME program re-compiled
with the older compiler works fine?
The code segment:
double num_double;
long num_long, num_long2;
Clear_String(str1, 30); // Simple loop setting each element to NULL
Clear_String(str2, 30); // Simple loop setting each element to NULL
StrCopy(str2, "78965);
num_long = StrAToI(str2);
num_double = (double)num_long;
num_long2 = (long)num_double;
StrIToA(str1, num_long2);
Write_Field(str1, Field2); // Output String to a Text-Field On Screen
I have broken it up and it works in smaller segments.
It will go from STRING to LONG to STRING.
It will go from DOUBLE to STRING.
It will go from LONG to DOUBLE to LONG to STRING.
num_double = (double)num_long;
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com