Float to int conversion (using Bare Bones)
Re:Float to int conversion (using Bare Bones)
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?
You did stuff like, trying to convert a char instead, or printing some non-null integer?
Every good solution is obvious once you've found it.
Re:Float to int conversion (using Bare Bones)
So what do you want to verify? That it is indeed a 0?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'.
Only Human
Re:Float to int conversion (using Bare Bones)
I'm sorry, I don't understand your question.Solar wrote: (...)
You did stuff like, trying to convert a char instead, or printing some non-null integer?
Re:Float to int conversion (using Bare Bones)
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.
That is the question.
Every good solution is obvious once you've found it.
Re:Float to int conversion (using Bare Bones)
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?
Now how do we know if my cross-compiler is borked or not?
What happens on a Linux cross-compiler with the same thing?
Only Human
Re:Float to int conversion (using Bare Bones)
That is the confusing part: I get a '7' on my Linux box. I even extended the test to include
and also got the 'H' as expected. :-\
Code: Select all
char * x = "Here";
...
((char *)0xb8000)[2] = x[0];
Every good solution is obvious once you've found it.
Re:Float to int conversion (using Bare Bones)
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
@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
Only Human
Re:Float to int conversion (using Bare Bones)
Not a cross-compiler at all, but my system compiler:Neo wrote: @Solar: What gcc cross compiler version were you using?
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)
Every good solution is obvious once you've found it.
Re:Float to int conversion (using Bare Bones)
@Marcio: Is your GCC version the same as mine or something else?
Only Human
Re:Float to int conversion (using Bare Bones)
My GCC version is 3.4.0Neo wrote: @Marcio: Is your GCC version the same as mine or something else?
Re:Float to int conversion (using Bare Bones)
Doesn't apply, really, since the only thing being "cross" here is the OS / exe format. Both host and target are ix86...
Every good solution is obvious once you've found it.