News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

CVS compile error

Started by kalxas, October 19, 2005, 05:29:30 PM

Previous topic - Next topic

kalxas

Hello!

I am trying to compile Code::Blocks for Linux without success so far.
I use WxWidgets 2.6.2 and GCC 4.01
My distibution is Mandriva 2006.

I downloaded the last version from the site but the makefile didn't work.
Then I got the lattest CVS code and used the bootstrap method.

I got the following error during the make process:

parser/parser.cpp: In member function 'void Parser::OnAllThreadsDone(CodeBlocksE vent&)':
parser/parser.cpp:844: error: cast from 'Parser*' to 'int' loses precision
make[4]: *** [parser.lo] Error 1
make[4]: Leaving directory `/home/kalxas/build/codeblocks-1.0/src/plugins/codeco mpletion'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/kalxas/build/codeblocks-1.0/src/plugins/codeco mpletion'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/kalxas/build/codeblocks-1.0/src/plugins'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/kalxas/build/codeblocks-1.0/src'
make: *** [all-recursive] Error 1

Can anyone help?

Thanks in advance.
kalxas

Urxae

Ah, that's a portability no-no: casting pointers to ints.
On what kind of machine are you compiling? (x86? x86-64? PPC?)
From the error message it looks like on your machine sizeof(Parser*) > sizeof(int).

kalxas

My machine is a Dual Core AMD64

Does this mean that I cannot compile Code::Blocks?

rickg22


thomas

#4
Hmm...

sizeof(int) == 4
sizeof(Parser*) == 8 under Linux 64bit?

What does wxEvent::SetInt do in 64 bit environments?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Urxae

Quote from: rickg22 on October 19, 2005, 08:22:40 PM
Argh! Is this a C::B bug? :(

Yes, and what's worse, it's one that was supposed to have been fixed. From "Code::Blocks compiles in 64 bit Linux!!":
Quote from: Promit on April 20, 2005, 04:34:33 AM
Mandrav: You were using wxCommandEvent::SetInt in several places to pass a Parser*. This is naturally no longer allowed, since int remains 4 bytes while Parser* is 8. I modified the code to always use wxCommandEvent::SetExtraLong instead of SetInt, but that didn't actually prevent the crash, even after modifying ALL of the SetInt calls rather than just the ones that used SetInt to transfer a pointer. I'm looking around the source, but if you have any insight as to where the problem might be, that'd be greatly appreciated.
Quote from: mandrav on April 20, 2005, 08:30:30 AM
You 're right. It was a quick-hack to pass around the Parser* while developing and it got left in there. What's worse, I forgot about it...
Thanks for reminding me :)

Either Yiannis forgot about it (again) even after being reminded, or it somehow snuck back in :(.
Well, to look at the bright side, at least the fix is known :D. (The crash they were talking about was the infamous "codecompletion plugin on Linux" one)

mandrav

@kalxas: I 've commited the fix in CVS. In a few hours it 'll be available in anonymous CVS too. Let's hope I 've fixed all the occurences :)

Quote from: Urxae on October 19, 2005, 10:25:38 PM
Either Yiannis forgot about it (again) even after being reminded, or it somehow snuck back in :(.

See, that's why I usually tell people to post a bug-report/feature-request: it's the only certain way of keeping a list of things to be done.
Thanks for the sarcasm anyway...
Be patient!
This bug will be fixed soon...

kalxas

Thanks a lot Yanni!
I will compile the source tommorow and report back the result :)

But I have a question:

Shouldn't it be sizeof(int) == 8 in a 64bit OS?

Thanks again!
Kalxas

mandrav

Quote from: kalxas on October 19, 2005, 11:01:23 PM
Shouldn't it be sizeof(int) == 8 in a 64bit OS?

I think that (int=32bit) and (long int=64bit) in 64-bit systems, but don't take my word for it. I have near-zero experience with 64-bit systems  :oops:
Be patient!
This bug will be fixed soon...

kalxas

I bought my first 64bit system, few months ago, and I didn't have the chance to test it with a 64 bit OS until now.
I was under the impression that I should get 64bits for the plain integer in my code, and this was the main reason I wanted to move to a pure 64bit OS. But, until now, all test show that sizeof(int) == 4 must be the case :(

So, in C::B you use a cast to get through this problem? Is this wxCommandEvent::SetExtraLong command a wrap of a reinterpret_cast() in Wx?

Cheers. :)
Kalxas

rickg22

Well as soon as RC2 is released, we'll be back on track with the bug reports :)

kalxas

I just completed compilation of Code::Blocks in my 64bit system with absolute success.
Thanks a lot guys!!!

Kalxas

PS. When is RC2 going to be released?

mandrav

Be patient!
This bug will be fixed soon...