Page 1 of 2
Strange Problem (gcc problem???)
Posted: Sun May 10, 2009 11:38 am
by finarfin
Hi,
yesterday i reinstalled linux on one of my PC's, after everithing installed correctly, i downloaded sources of my os, try to compile it and boot it.
Ther reseult is in that screenshoot:
It happens with:
but if i download from repository, a precompiled image of the os, it works, and also the same sources compiled on other pc's doesn't have any problem.
The only difference between pc's is on the GCC Version, the computer where os faults has a gcc 4.4, other pc's uses gcc 4.3.
Now i suppose the problem is GCC, and i was wondering: someone has experienced my same problem? It is really a compiler problem or my fault?
It could be the linker?
In laptop is 2.19.1
On Desktop (the computer wher i experienced that problem) 2.19.1.20090418
The starnge thing is that a precompiled image of that os works fine on all pc's, but if i compile the os with that pc i have that problem.
Anyone can help me?
Thanks
P.s. Sorry for my poor english
Re: Strange Problem (gcc problem???)
Posted: Sun May 10, 2009 12:44 pm
by whowhatwhere
finarfin wrote:but if i download from repository, a precompiled image of the os, it works, and also the same sources compiled on other pc's doesn't have any problem.
The only difference between pc's is on the GCC Version, the computer where os faults has a gcc 4.4, other pc's uses gcc 4.3.
I think there's your problem. Err....GCC's problem. They have this neat little habit of screwing over everything on a minor revision. Funny, that trend seems to occur on every GNUtard project.
Either way, I'd suggest looking
here to GCC proof the code.
Re: Strange Problem (gcc problem???)
Posted: Sun May 10, 2009 4:19 pm
by blound
i know this reply is general but, compile your code with -Werror and -Wall and save all the errors/warnings to a file. then locate the code that is not working and look for warnings in functions or code (variable use/initalization) etc related to the problem. assumptions you made about previously correct behavhiour could have easily been changed between versions.
Re: Strange Problem (gcc problem???)
Posted: Sun May 10, 2009 5:44 pm
by Love4Boobies
You didn't even tell us what the problem was, just shoved a stupid screenshot in our faces. So I should assume that you're expecting text instead of numbers or...? What are we even looking at? And why do we care that you downloaded Linux and the sources of your OS from the repo? It's like we should know about your poject and what modifications you made between versions.
Maybe you should provide more info. Also check what happens exactly at the point where you expect something that doesn't happen right. Maybe your code was broken all along and worked by mistake with the older version of GCC. Never just assume that GCC is broken, test your code thoroughly. I for one am pretty sure that you did something wrong. Actually after reading the pointless message you wrote, I am *certain*.
EDIT: What does "similar situation" even mean here? You give an example.
Re: Strange Problem (gcc problem???)
Posted: Sun May 10, 2009 6:01 pm
by whowhatwhere
Love4Boobies wrote:You didn't even tell us what the problem was, just shoved a stupid screenshot in our faces. So I should assume that you're expecting text instead of numbers or...? What are we even looking at? And why do we care that you downloaded Linux and the sources of your OS from the repo? It's like we should know about your poject and what modifications you made between versions.
Maybe you should provide more info. Also check what happens exactly at the point where you expect something that doesn't happen right. Maybe your code was broken all along and worked by mistake with the older version of GCC. On most occasions it's fair to just assume that GCC is broken over each new release, but you should test your code thoroughly anyway. I for one am pretty sure that you did something wrong. Actually after reading the pointless message you wrote, I am *certain*.
EDIT: What does "similar situation" even mean here? You give an example.
There, fixed that for you.
Re: Strange Problem (gcc problem???)
Posted: Sun May 10, 2009 6:03 pm
by Love4Boobies
Heh. Okay, sorry for sounding so troll-ish.
P.S.: not a native speaker either
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 12:27 am
by finarfin
Ok,
i'll repeat love4bubbies:
That problem happen only when i compile the sources with gcc 4.4, i'm not so silly to say "It's gcc" without even a try. But these are the facts:
1. If i compile my source on other pc's and use the image on pc with gcc 4.4 everithing works fine.
2. If i compile sources with gcc 4.4 i have the problem above.
Ok,
probably i didn't explain, but yes i expet some text after and not that numbers.
Ops sorry if my screenshot is so stupid. I thought that a screenshot of the problem was clearer than my english explanation.
Similar situation????
I don't give any example i only show you the error.
This evening i'll go to do other check.
And yeah you sounded very Trollish
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 12:58 am
by Solar
syntropy wrote:They have this neat little habit of screwing over everything on a minor revision.
Well? It's up to them to adjust internal workings as they see fit. It's up to us to fix breakages that occur in the non-standard things we do. I'm the last to defend GNU projects on principles, but AFAICT GCC made big improvements and very few changes for the worse since v3.3 or so...
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 12:59 am
by Tomaka17
syntropy wrote:I think there's your problem. Err....GCC's problem. They have this neat little habit of screwing over everything on a minor revision. Funny, that trend seems to occur on every GNUtard project.
Either way, I'd suggest looking
here to GCC proof the code.
If GCC 4.4 compiles things as complicated as Linux, you can't blame it for screwing up a self-made printf implementation
I mean that there is far much chances that finarfin's code is simply broken
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 1:41 am
by whowhatwhere
[redacted]
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 4:03 am
by Love4Boobies
Yes, but as I've mentioned before, your problem could have been there all along but might have worked by chance with the previous version of GCC - this sometimes happens, believe it or not. It might be a GCC problem as well but it doesn't look like one.
Maybe you could direct us to where those things get initialized there? I tried browsing a bit through your SVN repo but you organize things a bit different than the most projects and... well... I don't know italian
Anyway, what's supposed to be loaded there and where is the code that loads it?
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 6:23 am
by Solar
Love4Boobies wrote:I tried browsing a bit through your SVN repo but you organize things a bit different than the most projects and... well... I don't know italian
And this is a
perfect example for why strong English should be considered a must-have skill in software engineering, not even speaking of OS development. Anything
but English only makes things more difficult...
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 8:36 am
by Creature
Solar wrote:Love4Boobies wrote:I tried browsing a bit through your SVN repo but you organize things a bit different than the most projects and... well... I don't know italian
And this is a
perfect example for why strong English should be considered a must-have skill in software engineering, not even speaking of OS development. Anything
but English only makes things more difficult...
It's fine to have an OS with an Italian translation, but you should always use English as the main language and develop the OS in that. Then you'll be able to translate your OS later. Doing it in another language than English makes it hard for almost everyone to comprehend. English is the lingua franca of IT.
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 10:16 am
by Combuster
And foreign languages aren't practical either...
test.c:2: error: stray '\128' in program
test.c:2: error: stray '\128' in program
test.c:2: error: parse error before "kf"
test.c:2: error: stray '\181' in program
test.c:2: error: stray '\162' in program
test.c:2: error: stray '\223' in program
test.c: In function `main':
test.c:9: error: stray '\128' in program
test.c:9: error: stray '\128' in program
test.c:9: error: `gr' undeclared (first use in this function)
test.c:9: error: (Each undeclared identifier is reported only once
test.c:9: error: for each function it appears in.)
test.c:9: error: parse error before "kf"
test.c:9: error: stray '\181' in program
test.c:9: error: stray '\162' in program
test.c:9: error: stray '\223' in program
Re: Strange Problem (gcc problem???)
Posted: Mon May 11, 2009 2:08 pm
by finarfin
Now,
i'm going to check where the problem happens.
For the language, yes i know that english is the language for IT, when i started my project i didn't care about that (yes is my fault) now i'm trying to fix this "hole". Actually most of messages could be printed both in "italian" and in "english", you can choose the language at compile time.
That is not enough, i know, but is a start. in the future i'll care about that.
In normal situation after boot, i will have that situation:
http://finarfin.elenhost.org/images/okscreenshot.png
I'm sorry if you find that topic useless.
Now i'll go to see where my problem appear