You are not logged in.

#1 2005-12-03 14:42:40

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

gcc 3.4.4 package needed

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

#2 2005-12-03 15:03:02

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: gcc 3.4.4 package needed

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

#3 2005-12-03 15:18:34

pikass
Member
From: Schwartz space
Registered: 2005-11-28
Posts: 85

Re: gcc 3.4.4 package needed

It is much more likely that your sourcecode ist not gcc4 valid.

Offline

#4 2005-12-03 15:20:54

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

Yes 3.4.3 is good, can you give link to it?

tmok wrote:

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

#5 2005-12-03 15:25:22

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

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.

Offline

#6 2005-12-03 18:33:00

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: gcc 3.4.4 package needed

I'm uploading now, Majkijin, at 12Kbps approx. Give it about 30 minutes, then go here.

Oh yeah - md5sum is 363ce7d6ec0b55f3059e6ee9584e1816

Offline

#7 2005-12-03 18:45:21

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: gcc 3.4.4 package needed

Majkijin wrote:

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

#8 2005-12-03 23:03:55

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

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

#9 2005-12-03 23:12:06

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

Oh I've allmost forgotten. Thanks tomk. I downloaded it a little bit faster smile - also 1.2 but MBps smile. Thanks again.

Offline

#10 2005-12-04 02:57:13

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: gcc 3.4.4 package needed

Don't get me wrong, if it works with gcc 3.4, use it by all means.  I'm just... picky. tongue  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!  smile

Offline

#11 2005-12-04 13:08:29

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

Thanks Cerebral smile, 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

#12 2005-12-04 14:30:26

Cerebral
Forum Fellow
From: Waterloo, ON, CA
Registered: 2005-04-08
Posts: 3,108
Website

Re: gcc 3.4.4 package needed

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. tongue  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

#13 2005-12-04 21:00:22

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: gcc 3.4.4 package needed

Majkijin wrote:
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

#14 2005-12-04 23:08:03

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

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.

Offline

#15 2005-12-04 23:28:43

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: gcc 3.4.4 package needed

Majkijin wrote:
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

#16 2005-12-04 23:53:02

Majkijin
Member
From: AGH-UST Krakow, Poland
Registered: 2005-08-03
Posts: 18

Re: gcc 3.4.4 package needed

phrakture wrote:

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

Board footer

Powered by FluxBB