You are not logged in.
Pages: 1
Hi have any of you package or PKGBUILD of gcc-3.4.4. I need it because gcc >=4.0.0 is bugged in some way. I'm making software project at my univeristy and when I compile it on my computer in home nothing is working (I get segmentation foults). If I compile it at university all is working. I checked that I use different version of gcc, I ran knoppix with gcc 3.4 and compiled my program with it and then all was working. I want stay with Arch but I need gcc 3.4.
Thanks in advance.
Offline
I have 3.4.3 here - any use to you?
BTW, I don't think it's correct to say gcc 4.x is bugged, just because your app doesn't compile with it. Thousands of other apps work perfectly with 4, don't they?
Offline
It is much more likely that your sourcecode ist not gcc4 valid.
Offline
Yes 3.4.3 is good, can you give link to it?
BTW, I don't think it's correct to say gcc 4.x is bugged, just because your app doesn't compile with it.
My app compiles with 4.x without any errors but if it is compiled with 4.x it doesn't work, with 3.x there are no problems.
Offline
It is much more likely that your sourcecode ist not gcc4 valid.
My whole sourcecode is written with ANSI C standard, so gcc-4.x should works.
Offline
I'm uploading now, Majkijin, at 12Kbps approx. Give it about 30 minutes, then go here.
Oh yeah - md5sum is 363ce7d6ec0b55f3059e6ee9584e1816
Offline
I'm making software project at my univeristy and when I compile it on my computer in home nothing is working (I get segmentation foults).
If you're getting segfaults, run the code through GDB and figure out what's causing them. I'm willing to bet gcc 4 isn't the problem, but perhaps some assumptions you made in your code that work with gcc 3.4 don't work under gcc 4, which I'm told is much stricter.
Examples: have you initialized all your pointer variables properly before using them (even to NULL if necessary)?
Anywho, I find gdb to be one helluva kickass tool to figure this stuff out.
Offline
Yes I and not only I had debbuged it and there were happening very strange things. I'm sure everything in code is ok. I'd debbuged the same program compiled with gcc 3.x and gcc 4.x on the same mashine and there are different results. I really thing gcc 4.x in some way is bugged.
I give you example:
I do call to some function that gets 3 argumetns and return 1. In gcc-3.x everything is ok but in gcc-4.x if exactly 1 line before function call there are no call to printf that only print value of other, never used before and after, just created to use it in that printf varialable, I get segmentation falut. This is not normal I thing. Totally independent part of code, simple printf call makes program working. I repeat that while using binary compiled with 3.x there are no problems. I and my friends from university spent a lot time to find what is wrong and always every of us gets the same conclusions - something is wrong witch gcc-4.x.
Offline
Oh I've allmost forgotten. Thanks tomk. I downloaded it a little bit faster - also 1.2 but MBps . Thanks again.
Offline
Don't get me wrong, if it works with gcc 3.4, use it by all means. I'm just... picky. I can't get over wondering if there's something sneaky happening, maybe a buffer overrun or something... you've just piqued my curiousity, is all. Heh.
Ever run it through a valgrind session? pacman -S valgrind -- useful tool to debug memory leaks/invalid memory accesses. I got some really wierd errors on a program I was working on recently because I was accessing memory just outside of the allocated range; took me forever to locate.
Anywho, best of luck with your uni. project!
Offline
Thanks Cerebral , anyway just as I sad, if one line before call to function there are no call to printf I get segmentation fault. I forgot to tell you that if there are that printf then all arguments passed to my function and inside it, are OK - just the same as I used while calling it, but if there are no that printf, arguments passed to my function are different while passing and inside function body. This makes program (because that arguments are pointers) write to location that it shouldn't write and I get segfaults. I just cannot imagine why it is happening and fact that with 3.x everything is ok (with and without printf call) still makes me think that this is 4.x problem. I'm really no t good programmer I know I can be in mistake but at now every singns point me to think as I think.
Offline
Yikes... that sounds similar to really strange issues that were cropping up when I was working on NachOS for my OS course... we never did get those figured out. 'Course, we weren't using gcc4 for that, so that probably wasn't our problem. For us, we threw in a printf and the destructor of a certain class broke; take out the printf and it's fine. Ugh.
Offline
pikass wrote:It is much more likely that your sourcecode ist not gcc4 valid.
My whole sourcecode is written with ANSI C standard, so gcc-4.x should works.
ANSI C does not automatically mean your code works - track down your error, because if it's not working in gcc4, it's bad code.
Provide a testcase and I can tell you what's wrong.
Offline
ANSI C does not automatically mean your code works - track down your error, because if it's not working in gcc4, it's bad code.
If my code is ANSI C compatible, shouldn't gcc4 interpret it right way? Just as gcc3 do it?
Unfortunately I can't give you a sourcecode because not only I wrote it and for now we can't publish it. I will try to write a small program wich will demonstrate the same problem when I only find the time, or maby our team decide to publish it.
Offline
phrakture wrote:ANSI C does not automatically mean your code works - track down your error, because if it's not working in gcc4, it's bad code.
If my code is ANSI C compatible, shouldn't gcc4 interpret it right way? Just as gcc3 do it?
Unfortunately I can't give you a sourcecode because not only I wrote it and for now we can't publish it. I will try to write a small program wich will demonstrate the same problem when I only find the time, or maby our team decide to publish it.
No, because this is fully 100% ansi C compatible:
struct foo { int bar; };
struct foo *fp = 0;
return fp->bar; //bam, invalid pointer
There's about 30 variations on this. ANSI C compatible means it will *compile* but just because something compiles doesn't mean it works right.
Offline
There's about 30 variations on this. ANSI C compatible means it will *compile* but just because something compiles doesn't mean it works right.
Yes I can understand that not everything that can be compiled without errors can be run succesfully.
My program can be compiled without any errors but while running it gives different results depending on with wich gcc - 3.x or 4.x it was compiled. This is quite strange for me.
Offline
Pages: 1