GCC 4 ? (aka 'oops, they did it again)

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

GCC 4 ? (aka 'oops, they did it again)

Post by Pype.Clicker »

just to let you know: i'm reinstalling workstation (SuSE->ubuntu). First bad surprise: kubuntu comes with no compiler or even /usr/include preinstalled... second bad surprise, default version of GCC is GCC 4 ...

and my main concern with GCC 4.x is that it appears to generate code that uses "memset" or "memcpy" regardless of locally-defined inline functions ... As a result my good old "memops.h" are no longer protecting me from "missing 'memset' in .thread.o ..." error messages ...

The code i write that triggers such code generation is structure initialization, e.g.

Code: Select all

   *ptr = (struct MyStruct) {
      .field1=val1,
     // field2 will be initialized to a nul value by the compiler.
      .field3=val3,
   };
stonedzealot

Re:GCC 4 ? (aka 'oops, they did it again)

Post by stonedzealot »

sudo apt-get install gcc-3.3

Wouldn't that do you some good?

I'm a gentoo user myself, so I'm not sure how they switch between installed instances of GCC, but gcc-config is the application here.
User avatar
Candy
Member
Member
Posts: 3882
Joined: Tue Oct 17, 2006 11:33 pm
Location: Eindhoven

Re:GCC 4 ? (aka 'oops, they did it again)

Post by Candy »

Pype.Clicker wrote: just to let you know: i'm reinstalling workstation (SuSE->ubuntu). First bad surprise: kubuntu comes with no compiler or even /usr/include preinstalled... second bad surprise, default version of GCC is GCC 4 ...
Did you compile a cross-compiler? If not, why not try if that works better?

You can try compile options to GCC 4 that'll make it freestanding or such, which would help with this I think.

In the worst case, make a gcc 3 cross compiler.

The way to do it is of course in the FAQ.

(I never thought I'd be referring you to the FAQ)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:GCC 4 ? (aka 'oops, they did it again)

Post by Pype.Clicker »

well, i have indeed 'apt-get'd gcc-3 (and i'll probably apt-get 2.95.3 aswell since it's in the apt-cache aswell ...

Building a cross-compiler is on my todo list (and well, i quite know it's in the FAQ, thanks Solar for that ;) ... however i'm rather trying to integrate support about those 'specificities' into the build system rather than requiring people to build a proper GCC first and then only building clicker ...

If you wish to compile Clicker under cygwin, that's just fine. SET OSTYPE=cygwin should be all you'll have to do: i have support for both ELF and COFF included :-)
Post Reply