Page 3 of 3
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 1:29 am
by Solar
Still no time for / success in putting a Cygwin Cross-GCC together.
You did stuff like, trying to convert a char instead, or printing some non-null integer?
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 2:38 am
by Neo
Solar wrote:
He followed the BareBones example code from the Wiki, adding the code snipped quoted initially to his main(), and doesn't get the '7' he expected but a '0'.
So what do you want to verify? That it is indeed a 0?
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 3:33 am
by marcio.f
Solar wrote:
(...)
You did stuff like, trying to convert a char instead, or printing some non-null integer?
I'm sorry, I don't understand your question.
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 3:33 am
by Solar
The correct result would be a '7'. What is wrong with the BareBones tutorial that a Cygwin cross-compiler gives a '0' instead - or doesn't it, and it is his cross-compiler setup that is borked?
That is the question.
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 3:53 am
by Neo
Ok tried that out and got a '0' not a '7'.
Now how do we know if my cross-compiler is borked or not?
What happens on a Linux cross-compiler with the same thing?
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 4:42 am
by Solar
That is the confusing part: I get a '7' on my Linux box. I even extended the test to include
Code: Select all
char * x = "Here";
...
((char *)0xb8000)[2] = x[0];
and also got the 'H' as expected. :-\
Re:Float to int conversion (using Bare Bones)
Posted: Wed Jul 20, 2005 8:54 am
by Neo
Hmmm... so it looks like the CYGWIN gcc differs from the Linux one.
@Solar: What gcc cross compiler version were you using?
My CYGWIN one give this
Reading specs from /usr/cross/lib/gcc/i586-elf/3.4.1/specs
Configured with: ../gcc-3.4.1/configure --target=i586-elf --prefix=/usr/cross --disable-nls --enable-languages=c,c++ -without-headers : (reconfigured) ../gcc-3.4.1/configure --target=i586-elf --prefix=/usr/cross --disable-nls --enable-languages=c -without-headers
Thread model: single
gcc version 3.4.1
Re:Float to int conversion (using Bare Bones)
Posted: Thu Jul 21, 2005 1:42 am
by Solar
Neo wrote:
@Solar: What gcc cross compiler version were you using?
Not a cross-compiler at all, but my system compiler:
Code: Select all
Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/specs
Configured with: /var/tmp/portage/gcc-3.3.5.20050130-r1/work/gcc-3.3.5/configure --enable-version-specific-runtime-libs --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/3.3.5-20050130 --includedir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/3.3.5-20050130/info --with-gxx-include-dir=/usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.5-20050130/include/g++-v3 --host=i686-pc-linux-gnu --disable-altivec --disable-nls --with-system-zlib --disable-checking --disable-werror --disable-libunwind-exceptions --disable-multilib --disable-libgcj --enable-languages=c,c++,f77 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
Thread model: posix
gcc version 3.3.5-20050130 (Gentoo 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1)
Re:Float to int conversion (using Bare Bones)
Posted: Thu Jul 21, 2005 11:09 pm
by Neo
@Marcio: Is your GCC version the same as mine or something else?
Re:Float to int conversion (using Bare Bones)
Posted: Fri Jul 22, 2005 2:18 am
by marcio.f
Neo wrote:
@Marcio: Is your GCC version the same as mine or something else?
My GCC version is 3.4.0
Re:Float to int conversion (using Bare Bones)
Posted: Sun Jul 24, 2005 5:21 pm
by GLneo
Re:Float to int conversion (using Bare Bones)
Posted: Sun Jul 24, 2005 11:48 pm
by Solar
Doesn't apply, really, since the only thing being "cross" here is the OS / exe format. Both host and target are ix86...