Slashdot Mirror


GCC 3.0 Released

Phil Edwards, GCC Developer wrote in to say: "The first major release of the GNU Compiler Collection in nine years, GCC 3.0, is finished. There is a long list of new features, including a new x86 back-end, a new C++ library, and a new C++ ABI, to pick my three favorites. Note that the GCC project does not distribute binary packages, only source. And right now the server is heavily loaded, so if you intend to get the source tarball, please /. one of the many ftp mirror sites instead. Plans for 2.95.4 (bugfix release), 3.0.1 (bugfix release), and 3.1 (more user-visible features) are all in progress." MartinG points to this mailing list message announcing the upload.

210 comments

  1. Re:Umm... by Anonymous Coward · · Score: 1

    Be realistic... Any new major release, particularly something as complex as GCC, is -bound- to have a few bugs in it. There are only so many possible situations you can test something like this in before you call it 'good enough'.

    Fortunately GCC handles having multiple versions installed simultaniously rather well, so you can have 3.0 installed to take advantage of all the new features, AND have 2.9x (your pick..) installed for kernels, system tools, and anything that absolutely must work right.

  2. Alpha ? by Anonymous Coward · · Score: 1

    Their "New Features" page hasnt mentioned Alpha at all. Same stuff from 2.95.x ? Hopefully they just missed to mention it. Since the Gnu stuff does not compile cleanly with ccc and ccc is not available as source (make world with a binary-exception would suck, anyway), this would be a catasrthroy (as 2.95.x was on Alpha) ? Anyone Infos ?

    1. Re:Alpha ? by jameson · · Score: 1

      The last CVS snapshots I tried actually compiled a lot of C++ stuff without internal compiler errors, and the number of unexplainable segfaults (random jumps in the generated code) shrank a bit, too. This was two months ago; I, too, hope they finally fixed gcc to be a valid competitor to Compaq's proprietary compilers. Right now, it's practically impossible to compile Mozilla or KDE for Alpha, unless you spend a week working around the quirks with cxx. I truly hope the gcc guys fixed this; I don't see any reason to upgrade if they haven't (slightly less broken is still broken).

  3. ...is no problem at all.... by Anonymous Coward · · Score: 1

    ...because I'm still using Red Hat 6.0 with GNOME and Enlightenment and emacs 20.3.1 with the recommended patches.

    So I'm using the very best of 1999. So what? Everything works and it runs the Linux version of Alien Crossfire, so what else do I need?

    People upgrade way too often. Staying several versions behind ensures reliability.

    I'll probably upgrade to Red Hat 8.1 sometime in 2003, depending on what I'll need to run by then.

  4. DDoS by Anonymous Coward · · Score: 1

    "please /. one of the many ftp mirror sites instead."

    This ISN'T the kind of statement you want to make, now you have proof of a planned DDoS.

  5. Re:time for .0? by Anonymous Coward · · Score: 1

    Go to the gcc 3.0 page at gcc.gnu.org for links to benchmarks.

  6. Re:how much stuff with this break? by Anonymous Coward · · Score: 1

    It's not just KDE. A lot of GNOME programs contain C++ too, as does NS 4, Mozilla, the BB window manager, and many others. This isn't going to be nearly as bad as the glibc transition, but I do think it's going to be enough of a headache to warrant a clean install.

  7. Re:g++ 3.0 compilation speed by Anonymous Coward · · Score: 1

    Just fine. I built it with a 3.0 snapshot last week. POOMA also gives your compiler a good workout.

  8. Re:But can you debug your programs? by Anonymous Coward · · Score: 1

    I have been using Code Sourcery's GCC snapshots for a few weeks now. GDB has been working 100% for C++ code. In fact, it works incredibly well. We ported a Win32 app to Linux just so we could avoid the awful C++ support in MSVCs debugger (if I ever see that warning about a symbol truncated to 255 characters again, I'm going to punch someone; thank god for #pragma warning(disable:4786)). As a bonus, when you inspect a std::string with GDB you see the string as opposed to the MSVC debugger where you see a bunch of gibberish.

  9. Re:How about PGCC and EGCS.. by Anonymous Coward · · Score: 1

    Realy? was'nt GCC 2.8 merged with EGCS into the GCC 2.95 series?

  10. Re:Linux kernel by Anonymous Coward · · Score: 2

    Yes. See the changelogs.

  11. Re:Why does GCC require so much memory? by Anonymous Coward · · Score: 2

    My guess is they are focussing on features and compatibility and being free as in beer and speech rather than heavily optimizing code and processes at this time. On the other hand good programming practices which they seem to be embracing are steadily bringing preformance increases. Sure it may not be up to MSVC in speed but you can bet that given enough time and versions it will.

    Since you seem to have a technical inclination you might want to look at the source and see for yourself. Even a grep/diff between the present and last two versions may prove enlightening.

    pingmeep

  12. Re:Why does GCC require so much memory? by Anonymous Coward · · Score: 2

    Try turning off optimization on files like that. Every C++ compiler I've used on UNIX systems is painfully slow at optimizing template code.

    On the other hand, support for templates in MSVC++ is notoriously poor. For one thing, the MS compiler & linker don't support automatic template instantiation. You may not have noticed this because the IDE does the bookeeping for you and generates the template declarations needed by the compiler. For some reason, most compilers are faster when you turn of automatic instantiation and explicitly list the template instances you need.

    Also, perhaps the MS compiler isn't performing some of the same optimizations on template code.

  13. Re:so by Anonymous Coward · · Score: 2

    GCC, as most other compilers, bootstraps itself, that is, a small assembler program compiles a subset of the language in which a compiler for the whole language is then implemented (xgcc).

    No, it doesn't. That would be grossly nonportable. It uses your existing C compiler to compile itself, without optimization, and then compiles itself with that (to get the benefit of its optimizations &c); then it recompiles itself with *that* and compares the last two. If you don't have a C compiler, you can't build GCC (equally, if you don't have an Ada compiler, you can't build GNAT).

  14. Re:Performance increases in final code? by Anonymous Coward · · Score: 3
    2.96:

    hello world
    0.01user 0.00system 0:00.00elapsed 142%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (52major+9minor)pagefaults 0swaps

    3.0:

    hello world
    0.01user 0.00system 0:00.00elapsed 125%CPU (0avgtext+0avgdata 0maxresident)k
    0inputs+0outputs (31major+11minor)pagefaults 0swaps

  15. Re:GJC! GJC! by Lauri+Alanko · · Score: 2

    GJC is indeed cool, and it had the name before GCJ. Watch those acronyms. :)

    BTW, gcj and gjc work together. :)

  16. time for .0? by HeUnique · · Score: 2

    Well, it seems like all the upcoming Linux distributions are going to .0 now (Redhat 8.0, Mandrake 9!, SuSE 8.0) - as all the stuff are not backward compatible with 2.X (gcc 2.96 is also not compatible with 3.x nor 2.x)

    Has anyone done any performance tests? some benchmarks maybe? it would be really interesting to see this GCC against the upcoming commercial Intel C/C++ compiler..

    --
    Hetz (Heunique)
  17. Re:New libraries... Wahoo! by Micah · · Score: 2

    You're telling me. About 3 years ago I wrote C++ code and wanted to use the standard stringstream class. But all they had was strstream, a rather buggy knock-off of it.

    Now, stringstream still isn't in the standard library in Red Hat 7.1! One can only say that it's taken too long.

    ---

  18. Re:Why does GCC require so much memory? by David+Greene · · Score: 1
    Anyway, most of the C++ compilers I've used follow the original Cfront method for handling templates: Information about which template instances are required by which program unit are stored by the compiler in "instantiation request" files

    Right. This is the "control file" method I mentioned. IIRC, Cfront didn't implement this in a completely automatic way, though compilers that use this model have cleaned it up.

    I would think that explicit template instantiation would be faster than this method only because the compiler and prelinker aren't doing all of this bookeeping. The same amount of code should be compiled either way. That's why I don't really understand what makes the MSVC template instantiation method so fast.

    The overhead is not only in the bookeeping. The overhead is also in generating the instantiations. To do this the compiler has to re-parse the source and generate code (either by recompiling the entire object file all over again or placing just the generated template code in a separate object). Some implementations could avoid this by generating some sort of targeted template code (a la DyC or other runtime compilers), but I don't know of any implementation that does this. It's tough to know which dominates. It probably depends on how "integrated" the prelinker is (i.e. does it rely on external programs to analyze object files?).

    In contrast, the current gcc model (gcc 2.95 + GNU ld 2.8) is to let the compiler create all template instances required by a given unit during the compilation of that unit. Of course, this creates a lot of duplicate symbols. It is the purpose of the collect2 program to throw away the duplicates.

    Whoops! Yes, of course you are correct. This is a different model from the prelinker method. It does have the drawback of generating the same code over and over again, though it only has to parse each source file once.

    I seem to recall that collect2 is only used on ELF systems. How does instantiation work for other object types? I do recall, in the early days of EGCS, a repository (.rpo) notion that never quite worked for me. Has this been implemented correctly now? I didn't see much about how this all works in the 2.95.2 info files.

    Ironically, I don't find gcc to be any slower at compiling template code than most other UNIX compilers. In many cases, it's faster.

    It could be parsing speed, but that seems unlikely. It probably depends on how the other compilers implement "recompilation." There's a large design space trading off complexity and speed. Then again, maybe the prelinker bookkeeping really is expensive. I haven't seen any good numbers.

    However, I do know that most implementations in UNIX land are derived from the SGI implementation, which was derived from earlier HP work. In the version of the SGI implementation that the GCC team based their work on, all class template member functions and member templates were defined inline. I have never understood the justification for writing it that way. Perhaps the MS implementation of the STL makes considerably less use of inlining.

    This is an excellent point. The SGI STL is pretty braindead in terms of implementation. I'm very interested to see the fruits of Andrei Alexandrescu's YASTLI (Yet Another STL Implementation) project. His plan (documented on comp.lang.c++.moderated) is to implement the STL (hopefully all of the standard library eventually) using all of the modern design techniques (policies, traits, metaprogramming, typelists, etc.) to create a super-efficient version of the library. No compromises will be made for non-standard compilers, so it will be a good conformance test. g++ should do well in that regard.

    For those interested, his book Modern C++ Design gives some clues on what he's thinking. It's an excellent read and I highly recommend it for anyone interested in some of the latest C++ design techniques, especially concerning templates.

    --

    --

  19. Re:C++ standards by David+Greene · · Score: 1
    That may be true. The projects I'm working on don't use a lot of that due to their age. One could compile Blitz++ or Andrei Alexandrescu's Loki to find out. :)

    I did try my hand at some metaprogramming which used a bit of partial specialization. I was using (I think) 2.90.blah and it failed miserably. But that compiler was so old and buggy I'm sure it would work much better now.

    --

    --

  20. Re:Why does GCC require so much memory? by David+Greene · · Score: 1
    But for template instances that are required but don't have definitions visible, it will store some extra information in the object file to be used by the linker to re-invoke the compiler. This is one reason for the ABI change.

    That is very nice. It will allow better separation of interface and implementation.

    So am I. I've read some of his stuff, including Modern C++. Fascinating stuff, although it's difficult to justify using many of his techniques in production code.

    I'm curious as to why you say this. Is it the amount of inlined code or the fact that it's something akin to magic? :)

    --

    --

  21. Re:Why does GCC require so much memory? by David+Greene · · Score: 1
    Where I work, we're developing software that has a medium to long lifespan. I've got to write code with the expectation that it will be modified and maintained by other people who aren't likely to be exposed to these techniques. Clarity, simplicity, and adherence to standards are generally more important in our code than cleverness, and there has to be a compelling reason to do something unorthodox.

    I figured as much. Recently there was a discussion on comp.std.c++ on the STL's map interface. While not directly related to your concerns, I did get into an argument with Bjarne over the amount of time/money spent in trying to understand the standard library when a few simple changes could make life much easier for the average programmer. His viewpoint is that one must keep up with the latest techniques. I agree to a point, but understand the realistic situation you've outlined above, where not all members of the team can afford to live on the bleeding edge.

    IMHO one of the larger problems is the lack of adequate tools to analyze and debug C++ code. Using gdb is a nightmare with g++ and as you indicated, it is incredibly difficult to debug template metaprograms. At least some people (e.g. Jeremy Siek) are working on techiques to improve compiler error messages (concept checks)!

    --

    --

  22. Re:C++ standards by David+Greene · · Score: 2
    Which features do you need? The export keyword is not supported, but automatic instantiation works very well.

    I'm greatly anticipating the new C++ library. Finally we will have stringstream! For me the C++ library was the largest hole in the C++ implementation. The compiler itself has been quite good for some time, feature-wise.

    --

    --

  23. Re:Why does GCC require so much memory? by David+Greene · · Score: 5
    For one thing, the MS compiler & linker don't support automatic template instantiation. You may not have noticed this because the IDE does the bookeeping for you and generates the template declarations needed by the compiler.

    This is not a bad thing. In fact, it is a very valid (I'd say good!) design decision. Explanation below.

    For some reason, most compilers are faster when you turn of automatic instantiation and explicitly list the template instances you need.

    The reason explicit instantiation is so much faster is that the compiler doesn't have to compile your code twice. Automatic template instantiation requires some sort of support outside the compiler proper. For all the gory details, I recommend Stan Lippman's Inside the C++ Object Model. It's a little out of date and inaccurate (or more properly, misleading) at times, but for anyone interested in why C++ works the way it does and what sort of decisions the compiler makes when generating code, it's a great book. It dispels many of the common myths about C++'s performance and makes an honest evaluation of the cases where performance is negatively affected.

    But I digress. One of the most popular strategies for automatic template instantiation involves some sort of "collector" program. The basic idea is to collect all the object files that go into the final link and look for undefined symbols that refer to template code. The GNU collect2 program does this for g++. Once the symbols have been identified, the compiler needs some way of knowing how to recompile the source files that contain the template elements. Strategies include using control files generated by the compiler and collector, entries in the object files themselves (strings or symbols are common) or a combination of the two. Other strategies are possible as well. The driver script (the IDE in VC++) gathers this information and reinvokes the compiler to recompile the source files containing the needed template code, passing flags to tell the compiler to instantiate particular templates.

    After having implemented some of this, I have to tell you that it is all a tremendous pain in the neck. It's also quite, quite convenient and necessary for the user. :)

    As for the MS IDE, that's just another strategy for handling the problem. No compiler that I know of fully handles automatic template instantiation by itself. The closest that a compiler could come to this would be to aggregate the collector actions into the compiler as a separate phase. This is really no different that running a separate program and the "compiler" becomes the driver script (think g++), with the compiler proper (i.e. translation and transformation) being but one (usually, more than one) phase of compilation.

    Every C++ compiler I've used on UNIX systems is painfully slow at optimizing template code.

    Is this not true under Windows? I'm curious, as they should have many of the same problems. Optimizing template code is expensive because there is a lot of it and most of it is inlined. Inlining is not as trivial one might initially expect and it has large implications for transformation (optimization). Inlining usually greatly expands the size and scope of functions that are transformed. There are more nodes, more symbols and more analysis bookkeeping to handle. Many compiler algorithms have complexity of N^2 or worse (lots are NP-complete!) so things get dicey as code size expands. Strangely enough, this is also why transformation can speed up compilation -- it often removes nodes and symbols from the program!

    --

    --

  24. Re:no binaries? by Bill+Currie · · Score: 3
    And gcc comes with it's own compiler (also not built), just to compile the compiler.
    That's not particularly accurate. There is source for one, and only one, C compiler in gcc (and one each of the other languages). The way the gcc build process works (esp when using "make bootstrap", not sure if that's default now or not, been a while) is to:
    1. build just the C portion of GCC using the system compiler using no optimisations
    2. move the freshly built gcc aside (bins and object files) into ./stage1
    3. using the compiler in stage1, build all of the selected language portions of GCC, this time with optimisations.
    4. move this second compiler (bin and .o) into ./stage2
    5. using the gcc in stage2, build a third copy of gcc, with the exact same optimisations.
    6. compare the third copy of gcc with that in stage2, if they differ, bail out
    7. build aditional libs (stdc++, iberty, etc)
    8. (if specified) install libs and the stage3 compiler
    A slow, painful process (esp when doing porting work), but it ensures that GCC is at least good enough to build itself as the installed compiler is an exact copy of the compiler used to compile it.

    Bill - aka taniwha
    --

    --

    Bill - aka taniwha
    --
    Leave others their otherness. -- Aratak

  25. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Greg+Hewgill · · Score: 2

    There's a nifty preprocessor hack you can use to get around this problem in compilers that don't properly support the standard:

    #define for if(0);else for

    This causes the scope of the for control variable to be correct, without affecting other control flow semantics. The only practical disadvantage is your compiler may warn about the constant value in a conditional. And your sensibilities may be offended by using the preprocessor to redefine a keyword. :)

  26. partially correct (HP-UX) -you need a K&R compiler by emil · · Score: 4

    AFAIK, gcc requires a *K&R* C compiler, as documented in the first edition of The C Programming Language. It need not support function prototypes or the void type (I think).

    On UNIX systems that do not natively support and include gcc, one uses the system's C compiler to generate xgcc, which is GNU C (but not compiled by GNU C). One then uses xgcc to generate a GNU-compiled gcc. I don't know why xgcc is not normally installed and used, but I assume that it would be an ease-of-debugging issue (and you can also debug gcc-optimized code, which most vendor compilers will not do).

    HP-UX natively includes a K&R (non-ANSI) C compiler. It is almost useless, but it will successfully compile gcc. On most other commercial UNIX systems, if you lack a compiler, you must rely upon someone who has a compiler to generate a verstion of gcc for you (which accounts for the popularity of packaged gcc versions on many platforms). This can also be complicated by licensing of the system include files and libraries.

  27. Re:Here's the funny thing... by MassacrE · · Score: 1
    How about complaining that redhat shipped a compiler that couldn't even compile the linux kernel? That they ended up shipping two compilers because of this, but expecting that people would accept that it could compile *other* code correctly?

    Defend RedHat all you want, but it still turns out they shipped what basically amounted to a development snapshot as their compiler, and also didn't indicate in any way (in the initial versions) that it was not an official GCC release, and left the help indicating that the GCC team should be contacted in the case of bugs. They shipped a compiler neither compatible with 2.95.x or 3.x - they released a compiler that is not binary compatible with any release of GCC, ever.

    But at least the release of 7.0 convinced me to try out Debian. Unfortunately it also pissed off a lot of people who equated RedHat to Linux, and now will end up taking a long time to give Linux another chance.

  28. Re:pragmas by Eccles · · Score: 2

    What about the following, surely it's good ?

    #pragma once


    It's not good, and don't call me Shirley.

    Seriously, though, the gcc approach to this is, I think, better, if rather more verbose and awkward-looking. As I understand it, gcc looks for include guards, code like

    #ifndef _MYFILE_H
    #define _MYFILE_H
    ...
    #endif

    and if it finds it, it treats that like #pragma once for the given file. So there's no incompatibility with compilers that don't support #pragma once. Meanwhile, if for some necessary evil you need to include MyFile.h again, simply #undef _MYFILE_H and go.

    --
    Ooh, a sarcasm detector. Oh, that's a real useful invention.
  29. Re:gcj now integrated by X · · Score: 1

    Actually, you can get by with jikes for dependency generation at least.

    --
    sigs are a waste of space
  30. No by Per+Abrahamsen · · Score: 1

    It is the only major C++ fature not yet implemented.

  31. C99 has dynamic arrays by Per+Abrahamsen · · Score: 1

    ... but I'm not sure they implement it exactly like GCC.

    1. Re:C99 has dynamic arrays by Unknown+Lamer · · Score: 2

      Actually, (if I am reading the C99 conformance page right), variable sized arrays are broken. I guess that is why the release notes said 3.0 supports _almost_ all of the features of 2.95.x (because 2.95.x did support variable sized arrays). Now that I know gcc has a typeof keyword...evil gcc! How dare it tempt me to write non-standards conforming code! (of course, the only use I see for typeof is for safe vararg functions...typeof(va_peek(arglist)) foo = va_next(arglist)...). Well, back on topic I guess (wait, this entire message is about gcc so hah!)

      -------------

      --

      HAL 7000, fewer features than the HAL 9000, but just as homicidal!
  32. It is worse than that... by Per+Abrahamsen · · Score: 2
    In short, the 2.9x line (which Redhat admittedly bastardized a bit by grabbing a snapshot and calling it 2.96) will still be fixed for bugs.
    Acutally, Red Hat GCC 2.96 is much closer to GCC 3.0 than to GCC 2.95.3. Except for the C++ library, which is basically the same as in 2.95.3. This put Red Hat in an odd situation, they will have to track the 3.0 compiler and the 2.95 library, if they want to remain compatible with their own 2.96 release. However, they employ many of the best GCC engineers, so if anyone can do it, it will be them.

    I'd prefer them to swicth to 3.0 at the earliest possible location, though.

    1. Re:It is worse than that... by HiThere · · Score: 2

      There have been indication that that's what they intend on doing. What I wonder is 7.2 or 8.0 ... my guess would be 8.0 (keeping up with the Mandrake's?).


      Caution: Now approaching the (technological) singularity.

      --

      I think we've pushed this "anyone can grow up to be president" thing too far.
  33. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Per+Abrahamsen · · Score: 2

    It also compiles with GCC, with a warning. The code used to be correct, but the standard commite changed the rules.

  34. Solaris is also affected by Per+Abrahamsen · · Score: 2

    Which means you must compile your C++ applications with the same GCC version as your C++ libraries.

  35. Re:How about PGCC and EGCS.. by Per+Abrahamsen · · Score: 2

    I believe GCC 2.8 was only fully merged back into EGCS in GCC 3.0.

  36. "a repeat of the gcc-2.96-REDHAT fiasco?" by Per+Abrahamsen · · Score: 3

    Yes. That is the point of the "gcc 2.96 Red Hat fiasco". The C++ library and ABI has been changed in 3.0 in order to conform to the C++ standard, as well as new cross-compiler C++ ABI standard, and to be much more efficient. The problem with the Red Hat release was that it was released half-way through that process, so it would be both forward and backward incompatible with the official FSF releases.

    In most other ways, the unofficial gcc 2.96 is an improvement over 2.95, and for C code compatibility is as good as between any two releases of gcc. Mostly GCC 2.96 catches a few bugs that 2.95 failed to notice.

  37. Re:g++ 3.0 compilation speed by Per+Abrahamsen · · Score: 3

    Programs that uses iostreams will tend to be slower, because of the new (ISO mandated) template based iostream implementation. In particular, a "hello world" program will tend to compile much slower, since it spend most of its time in the header.

    Other programs can compile much faster or much slower, depending on what the bottleneck used to be, and what features they excersize.

    There are several implementations of precompiled headers for GCC, which are likely to give a large boost in compilation speed when one of them is selected for inclusion.

  38. Re:How about PGCC and EGCS.. by Per+Abrahamsen · · Score: 4

    GCC is basically a new name for EGCS.

    I don't know about PGCC, but since GCC 3.0 has a brand new ia32 backend with focus on Pentium II performance, chances are that PGCC is no longer relevant.

  39. What about Redhat's users though! by Sanity · · Score: 2
    I can't quite tell if this post is serious or not, assuming it is:

    It may be great for GCC that RedHat provided them with a wide-scale test of their software, but what about users of RedHat who were stuck with a buggy version of GCC for months?

    --

  40. Re:so by Sabalon · · Score: 2

    Good point. Since at some point the first GCC had to be cross-compiled or bootstrapped from a non-gcc, non-gpl, and therefore probably commercial/proprietary compiler, does that mean that all off gcc is non-gpl derived?

    So, since the original gcc was non-gpl derived, then everything built with gcc, while it may be gpl derived, is truly non-gpl derived.

    So, if you wanna build an application based on gpl code and not distribute it does that mean it's okay?

    (Yes...for the GPL or death people, this is a joke)

  41. Re:ISO C++ limits scope to the loop by Malc · · Score: 1

    "The code you posted is legal (modulo the missing signs). The only current compiler I know which doesn't think so is MSVC++ 6, which is so far from the C++ Standard as to be a joke. "

    Really? Do you use MSVC 6 much?

    The single biggest problem that I've had writing x-platform code from MSVC was the for loop decl-init. This was with code written under MSVC and then recompiled on the Mac under Code Warrior. The next biggest was the use of exception specifiers, which most people don't seem to use anyway (MSVC ignores then and doesn't abort when exceptions that don't fit the specifier are thrown). Finally a couple of minor issues such as a semi-colon after the closing brace of a namespace (CW doesn't like them, MSVC doesn't care), casting in this form: uiVarB = unsigned int(ulVarA) - (MSVC was happy, CW wasn't), and scoping (CW needed more explicit scoping in some places than MSVC).

    Except for the for loop variable issue, it's pretty easy writing ANSI C++ in MSVC. Your programming skills are a joke if you can't do it. Every C++ compiler that I've used deviates from ANSI C++ at some point, and some more than others. In the grand scheme of things, MSVC isn't really that bad for compliance, and what is more, it appears that they are still working on improving it.

  42. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Malc · · Score: 2

    Wow: they're really going to fix that bug? They've known about it for several versions of MSVC (4, 5, 6), but seemed unwilling to change it. Fixing it will surely break a lot of code and presumably require a new compiler directive to build old code unmodified. This bug has been irritating me for a long time as I've been writing code that must also compile on the Mac, and every now and again I slip up and forget to declare a loop variable before the loop, and then try to use it after the loop.

  43. Why does GCC require so much memory? by Malc · · Score: 3
    From http://gcc.gnu.org/news/inlining.html (linked to in the list of new features):

    "As a result, the compiler may use dramatically less time and memory to compile programs that make heavy use of templates, such as C++ expression-template programs. One program that previously required 247MB of memory to compile, and about six minutes of compile time, now takes only 157MB and about two minutes to compile. "


    I remember try to build the TAO (the ACE ORB) a few years ago. Under Linux using GCC, a couple of files consumed all of virtual memory (requiring 250MB of memory). When I had sufficient, it would take my 128MB machine 45 to 70 mins to compile those particular files (lots of swapping). The same files under Windows with MSVC would take less than 20MB and thus compile in under a minute. What is GCC doing that requires so much memory? Is it me, or is this new inliner (that is such an improvement) still a memory hungry hog? Why? (Technical answers preferred).
  44. export keyword by Kenneth+Stephen · · Score: 1

    Does anyone know when support for the C++ "export" keyword is expected? Is someone working on this already?

    --

    There is no such thing as luck. Luck is nothing but an absence of bad luck.

  45. Something else gcc let me do... by Derek+Pomery · · Score: 1

    int main(int argc, char *argv[])
    {
    int ary[atoi(argv[1])][atoi(argv[1])];
    return 0;
    }

    Convenient, no? Instead of doing a for loop and malloc()ing through it?

    But completely uncompilable on any sane compiler. :)

    --
    -- perl -e'print pack"H*","6e656d6f406d38792e6f7267"' /. ate my old sig. Bastards.
  46. Re:Here's the funny thing... by mikpos · · Score: 2

    C++ really doesn't have much to do with it. gcc's C and C++ front-ends are kept separate and have been for some time.

  47. C99 does by mikpos · · Score: 2

    C99 does allow declarations to be mixed with statements in any order. See section 6.8.2 of the standard.

  48. Re:partially correct (HP-UX) -you need a K&R compi by peter · · Score: 1

    > Nothing to do with it. Everything after stage1 is a consistency check.

    Not quite. Assuming GCC generates faster/better code than the native compiler, installing GCC compiled by GCC will make compiling other program happen faster.

    Thanks for pointing out the consistency check going on with stage 3. I hadn't known why it was useful to build gcc again with gcc.

    #define X(x,y) x##y

    --
    #define X(x,y) x##y
    Peter Cordes ; e-mail: X(peter@cordes , .ca)
  49. New libraries... Wahoo! by Lally+Singh · · Score: 3
    I'm really glad to hear about the new C++ libraries. The compiler's been pretty good about compliance so far, but the libraries have sucked for quite a while now. Glad to see the improvement...

    --

    --
    Care about electronic freedom? Consider donating to the EFF!
    1. Re:New libraries... Wahoo! by devphil · · Score: 2

      There are two C++ libraries: v2 and v3. Only strstreams were available in v2. v2 has been dead for a couple years now; it gets bare-minimum maintaining while everybody works on v3.

      GCC 2.9x, including the RH versions, ship with v2. Many people have written their own implementation of stringstreams for use with 2.9x.

      v3 has had stringstreams for quite a while, but GCC 3.0 is the first official release to ship with v3.

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  50. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by spitzak · · Score: 2
    I'm sure they can do the same thing gcc does, which is produce a warning message and then compile the code as it was before.

    The Irix C++ compiler has this problem as well, but worse than VC++ because it produced an error if you declared a variable more than once (apparently VC++ silently allows this, which is why I was not even aware it did the scoping wrong until I tested it explicitly). The Irix problem meant that two for loops with the same "local" index variable would not compile, and since we also had compilers that obeyed C++ rules we have to insert the "int" declaration before the first for loop. This also broke a macro that relied on a local variable.

    Fortunately the switch "-LANG:ansi-for-init-scope=ON" turns it on (they seem to have figured out how to be even more verbose than gcc, sigh...) I just recently learned you turn this off (ie switch to C++ mode) with

  51. Re:Umm... by yendor · · Score: 2

    The first thing you do when you've released something is work your ass off to get it right.
    This isn't supposed to take 3 months like M$ sometimes seems to think it should.

    The way programmers are pushed today the first x.0 is mostly more of a beta than a release.

    Not a problem realy if you got more time at bugfixing but since the company that's behing them don't earn money unless it's out there we won't see a change before that changes.

    // yendor

    --
    It could be coffe.... or it could just be some warm brown liquid containing lots of caffeen.

  52. Re:g++ 3.0 compilation speed by Ben+Hutchings · · Score: 2

    VC++ 5.0 and 6.0 shipped with an old iostream library (iostream.h etc, global namespace) and a mostly standard C++ library including iostreams. The standard C++ library was provided (indirectly) by Dinkumware. Due to a legal dispute between Dinkumware and the company in the middle, this wasn't updated in 6.0 and so was not updated to match the standard (in any case, the VC++ compiler could not support all library features). This should be fixed in VC++ 7.0 (currently in beta, AFAIK).

  53. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Ben+Hutchings · · Score: 2

    Using macros to redefine keywords generally results in undefined behaviour (standard paragraph 17.4.3.1.1.2), so one's sensibilities should be offended. As a compiler-specific workaround this macro definition is obviously a necessary evil, but it should never be included in code that is meant to be portable.

  54. Re:But can you debug your programs? by Ben+Hutchings · · Score: 2

    The VC++ debugger will certainly show the contents of a std::string if you use the supplied standard library. I'm not sure how you would expect it to support replacement libraries.

  55. Re:Still the slowest compiler around? by khuber · · Score: 1

    I agree that gcc isn't very fast. You can
    try -pipe, a lower -O setting, multiple
    CPUs, and so on to speed things up.

    However, that is a pretty bad way to set up
    a project anyway. It should be split into
    more manageable, seperately compilable,
    pieces.

    -Kevin

  56. Re:Umm... by garcia · · Score: 2

    at least they say ahead of time that they will be releasing a "bug fix" version. Not like other programs that don't release bug fix versions for years ;-)

  57. Re:Here's the funny thing... by Mr+Z · · Score: 1
    WTF? Why add features to something you're deprecating?

    Hey, the same thing happened in the C standard, where common vendor extensions were explicitly taken into account when ANSI drafted the C standard. Things such as using /**/ in a #define to splice tokens were never defined by K&R, but were available in some compilers. ANSI C deprecated this common practice in favor of the new, well-defined ## operator.

    If Standards Committees did not take into account current common practice, that would surely be madness.

    --Joe
    --
  58. Re:What is an ABI? Re:how much stuff with this bre by Mr+Z · · Score: 1

    Yes, the ABI is the Application Binary Interface. This describes various aspects of the run time environment, such as how functions call each other (eg. how to place arguments of various types in registers or on the stack, etc), how scalars and aggregates are laid out in memory, how OS and library calls are made, etc. It's essentially a description of how a given function interfaces to the rest of "the machine."

    Make sense?

    Basically, two object files that are compiled with the same ABI can be linked to each other without any real fuss. If they use different ABIs, they potentially won't agree on even the simplest of assumptions (including, potentially, even what sizeof(int) is).

    --Joe
    --
  59. Re:Linux kernel by Art+Tatum · · Score: 1

    I tried and it worked mostly alright. *HOWEVER* when I try to mount a FAT32 partition, it oopses. Plus, when I attempt to shutdown or reboot, it hangs when trying to umount. Other than that, it seems to be OK. ;-)

  60. But don't forget by Ian+Schmidt · · Score: 5

    The very reason GCC 3.0 is out now rather than in 2005 is precisely because RH "jumped the gun" and submitted hundreds of bugfix patches to GCC 3.0 in the process. Meanwhile Redhat's GCC 2.96-81 is less buggy in my experience than 2.95.2 and the new features are great.

  61. Re:Umm... by grahamm · · Score: 1

    gcc 3.0 should compile kernels with no problems. Was linux kernel compilation not one of the release criteria for gcc 3.0?

  62. Re:Here's the funny thing... by elflord · · Score: 1

    It's true that the newer compilers reject a lot of broken code. However, what do you think of his take on binary compatibility ? Are C++ developers really supposed to ship static binaries ? What if the code uses dl-modules ? I think he's trying too hard in his role as apologist. If he'd stick to debunking the complaints about non-standard code not compiling, I'd almost take that page seriously.

  63. Re:GJC! GJC! - GCJ! GCJ! by IIO · · Score: 1

    GJC was used by the GJ compiler (Generic Java) which is going into JDK 1.5.

    Talking about which, Generics needs to get into GCJ too.

    --
    -- Weiqi Gao weiqigao@speakeasy.net
  64. Re:Here's the funny thing... by DJerman · · Score: 2

    Yeah, but now when we fix code we'll have a reasonable expectation that the compiler feature that's complaining works (less guesswork as to whose bug it is).

    --
  65. Re:Here's the funny thing... by rhavyn · · Score: 2

    No, his comments on that are quite straightforward. GCC has never been binary compatible with itself across versions before. Redhat 7.x isn't binary compatible with *anything* because it uses glibc 2.2. 2.95.2 doesn't support IA64, one of the supported architectures of Redhat. Only needing to support one compiler across all architectures is much simpler.

    I believe that those reasons pretty much account for both his reasons why it doesn't matter and why Redhat went with the decisions.

  66. Re:how much stuff with this break? by rhavyn · · Score: 2

    kgcc was included because the kernel was broken, not GCC. You can even look it up in the kernel mailing lists. Linus considered gcc 2.96 a good way to start getting Linux ready for gcc 3.0. Neither the gcc developers nor the Linux developers could have made it a "policy" that redhat had to include kgcc. Redhat did it because they knew that the kernel wouldn't compile on gcc 2.96 and they had to include a compiler that would compile the kernel.

    Futhermore, even the gcc guys have admitted that using gcc 2.96 (which was really the name of the development branch) spead up development because of the bugfixes that were generated.

    Why don't we all complain about them including glibc 2.2 as well? I mean, that breaks binary compatibility with all the other distributions too.

  67. In related news by funkman · · Score: 2

    Slashdot already talked about this. (Actually the link is stating that 3.0 is rumored to be released soon)

  68. 64-bit Solaris? by shr · · Score: 1

    Does anyone know the status of the 64-bit gcc for Sparc Solaris?

  69. They're looking professional!!! by Hammer · · Score: 1

    We all know that there is no chance of finding / fixing all bugs prior to release. Assuming that all monumental showstoppers have been addressed there are likely a whack of unknown "unintended features" as well as a few known defects that is not yet fixed.
    Stating upfront that "we know about these bugs and plan to fix them in 3.0.1" is really professional behaviour. And it gets the compiler ot to a broader group for use/test...

  70. Re:The GCC developers should thank RedHat by HiThere · · Score: 2

    Red Hat did ship the older compiler also. They just gave it a different name. If you wanted, there wasn't any problem in using it. If you used the new one, you were getting ready for now.

    (Well, actually for a few weeks from now. This is a *.0 release, so I'll give it a bit of time to settle out, and use 2.95x for now.)

    Caution: Now approaching the (technological) singularity.

    --

    I think we've pushed this "anyone can grow up to be president" thing too far.
  71. Re:Umm... by Tim+C · · Score: 4

    I'd say they're just being realistic. No matter how good your QA process, the chances of catching and squashing every single bug before release are minimal. The best you can realistically hope to do is catch all the real show stoppers. (Assuming that you actually do want to release the product at some point, that is)

    Having said that, this is the first time (that I can remember) that I've seen an officially-planned x.0.1 bugfix release announced at the same time :)

    Cheers,

    Tim

  72. Re:how much stuff with this break? by Raphael · · Score: 4
    [...] the big question is "how much stuff is this going to break?

    Not much, hopefully.

    The only major thing that can affect the binary packages is the new C++ ABI. But for plain C programs, there should be no big difference. Most of the Linux programs and libraries are written in C and should not be affected significantly. This could be a problem for Qt and KDE packages, though.

    See also the list of caveats on the GCC web site.

    --
    -Raphaël
  73. Re:Still the slowest compiler around? by Per+Bothner · · Score: 2
    I did not hear anything about a fix/implementation of the precompiled header support.
    It has been discussed many times, and there are some experimental implementations.

    Or is it really so difficult to correctly implement it?
    It is not only difficult to correct implement it, it is also difficult to agree on what it should do. People say "precompiled headers" but what the hell does that mean? What do you compile header files into? Do you compile a single header file into some kind of "precompiled header object file" (doesn't save you that much but is easy to use) or do you use some kind of pre-project data base (saves you more but may be more difficult to use) or what?

    Note also that GCC developers use Makefiles, while most commercial Windows developers use an integrated IDE. It is easier to do all kinds of performance tricks when everything is integrated in one big program that you control.

    I know there are many people interested in the problem, and I believe some may actually be working on it. It just isn't that easy if you want something that isn't a kludge. My impression (un-verified) is that many of the existing compilers that support pre-compiled header files use various kludges that may be useful but not necessarily well-designed. A pre-compiled header file solution for GCC has to be something we can live with for many years.

  74. Re:GJC! GJC! - GCJ! GCJ! by Per+Bothner · · Score: 4
    Er, it's GCJ (GNU Compiler for the Java [TM] programming language), not GJC. (You're not supposed to call it plain "GNU Compiler for Java" because of Sun's trademark on "Java".)

    We did consider the name GJC (back in '96 when the project was started), but for some reason I don't remember (I think it was trademark-related) we decided on GCJ.

    I'm very glad to see GCJ in a mainstream GCC release, and hope it will finally get the attention I think it deserves.

  75. Re:Here's the funny thing... by JabberWokky · · Score: 2
    I have a feeling quite a few people are gonna be red in the face over this one.

    I doubt it. There *is* no C99 compliant compiler... and since C and C++ standards almost always seem to contradict themselves in one or two spots, it's unlikely that there ever will be one.

    And it's not such a bad thing - the face="" paramater to the font tag is invalid HTML. I guess the web in general should be red in the face?

    --
    Evan "And I'll invent *another* dozen specs *after* lunch!" E.

    --
    "$30 for the One True Ring. $10 each additional ring!" -- JRR "Bob" Tolkien
  76. Re:Linux kernel by Neon+Spiral+Injector · · Score: 2

    I didn't even get the compile of 2.4.5 to finish. Died pretty early on in kernel/timer.c

    Good thing I didn't put it on our production server (no I didn't really consider it).

    --

  77. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Galahad · · Score: 3

    You've got it backwards. MS VC has it wrong too. the declaration of i in your example is scoped with the body of the for loop. 'i' does not exist after the closing brace of the for-loop.

    This is per the ANSI/ISO C++ standard.

    --
    --jdp Maintainer of VisEmacs
  78. But can you debug your programs? by Kevin+S.+Van+Horn · · Score: 2

    My problem with gcc's C++ compiler has been that there is no workable compiler for it. Gdb just falls to pieces when you try to debug C++ code (it can't find symbols, it can't handle user-defined operator overloads, sometimes it gets mixed up and gives you the wrong values for variables, etc.) Is there an update to gdb to go with the new gcc that provides reasonable support for C++?

    1. Re:But can you debug your programs? by marcovje · · Score: 1


      Try the CVS. I also managed to get (Free) Pascal support running with post 5.0 GDB CVS on FreeBSD with some patches.

      When I last checked (6 months ago), the CVS was in a pretty usable form.

  79. Re:GJC! GJC! by ianezz · · Score: 2
    Finally, all my keen little utility programs ... will run as fast as OS level stuff

    It could be. If I'm understanding it correctly, many common operations have to be performed at runtime anyway (i.e. checking type safety for downcasts, which is usually the case if you use the collection classes, or checking array boundaries, etc.). Please also consider that critical sections are already implemented natively by the Java environments you can find out there, and I doubt these are going to gain anything...

    There probably will be a speedup because of optimizations (i.e. inlining, or loop unrolling optimized for the specific platform), but I'd be far more cautios before making enusiasthic statements like that.

  80. Re:Linux kernel by arjun · · Score: 1

    yes. but will you want to *run* the kernel once
    it has compiled ?

  81. Re:Umm... by Penrif · · Score: 1

    Having said that, this is the first time (that I can remember) that I've seen an officially-planned x.0.1 bugfix release announced at the same time :)

    Hence the spooky part.

  82. Re:so by Wodin · · Score: 1

    Argh! When will this bloody BSD-bashing-bot stop posting this drivel in the hopes someone will take it seriously?

    --
    -- Wodin
  83. GCC and sparcv9/Solaris 64-bit by lart · · Score: 1

    Does gcc support compiling for 64-bit Solaris yet?

    1. Re:GCC and sparcv9/Solaris 64-bit by AndroSyn · · Score: 1

      Yes it does. The CVS snapshots have for quite a while, it just wasn't too terribly stable. I'm uncertain that it is stable now, but I haven't seen any problems with it yet.

  84. Re:its all quite unambiguous... by SpinyNorman · · Score: 1

    Hmm.. then I wonder why they decided to define:

    for (int i = 0; ...) S

    as:

    int i; for (i = 0; ...) S

    rather than:

    {int i; for (i = 0; ...) S}

    Oh, well! :-(

  85. Re:its all quite unambiguous... by SpinyNorman · · Score: 1

    Damn, so C99 is OK, but I'm going insane...

    gotta learn to read... gotta learn to read...

  86. Re:its all quite unambiguous... by SpinyNorman · · Score: 2

    Yuk! Does C99 allow nested scopes at all...

    {
    int i;
    {
    int i;

    Is this legal, or a redefinition?

  87. C++ standards by sien · · Score: 1

    Does 3.0 fully comply with the standards for templates, I think it's the 99 C++ standard ?
    I had a quick look but the information didn't jump out at me and perhaps someone here knows, but perhaps I'm just being optimistic.

    1. Re:C++ standards by sien · · Score: 1

      I thought that GCC didn't quite have the full spec on partial template specialisation. Is this the case ?

  88. Re:Red Hat's problem... by ajs · · Score: 2

    In the gcc-v3 distribution they've been working for many months.

    Exactly. Now, step back and think about WHEN Red Hat 7.0 was released.... Red Hat made a hard decision. They had to release a 1.5-year old C++ compiler that did not track the standard or the latest version of C++ off of the 3.0 development snapshots. They did the latter because they felt it would serve more of their customers' interests, and they had the technical staff to back that decision up.

    Then, they got burned from both sides. The folks who were writing non-standard C++ complained because their programs no longer compiled. The folks who were tracking the GCC development and the ANSI standard complained that it did not go far enough.

    The kicker is that, had they been Sun, releasing ACC, people would have groned because their code broke, put a bunch of #ifdefs in their code (or modified their autoconfigs) and gone on with life. But, because we have a porthole into the development process, we feel we're qualified to second-guess the distribution-creation process. Personally, I'm impressed that Red Hat (or Debian or SuSe, etc) can package a distribution at all, given the huge number of projects and no real coordination between them.


    --
    Aaron Sherman (ajs@ajs.com)

  89. Re:Red Hat's problem... by ajs · · Score: 2

    This is just not true. GCC 2.95 and was horribly out of date with respect to the ANSI C++ standard. The problem was always that GCC was one of the first C++ compilers, and so it's been evolving along with the C++ language. So, one of the major thrusts in 3.0 (or rather, something so radical that it was not entering the 2.x series) was to incompatibly change much of the C++ implementation to match the ANSI C++ standard (hopefully this will freeze most major work on GCC's C++ so that people can start to rely on source-compatibility with future versions).

    Red Hat's 2.96 was a pre-release of 3.0, which they released because they felt that their customers needed many of those features, and that back-fitting them to 2.95 would be too large a task for too little return to the GCC effort (which, recall Cygnus is a MAJOR participant in).

    --
    Aaron Sherman (ajs@ajs.com)

  90. Re:Red Hat's problem... by ajs · · Score: 4

    Of course, they will do what they've always done (and every other commercial vendor with large customers does). They will distribute "obsolete" software until their next version, when they will go with the almost-latest-and-greatest that they can get to work.

    You have to understand, Red Hat bowed to their customers. Many of their C++ customers told them they needed ANSI C++ compliance badly. GCC 2.96 offered that.

    Red Hat has a history of working hard on the compiler, and distributing a custom version. They were the first distribution to ship egcs (remember, 6.2 ran egcs for the C++ compiler). They also did a lot of work on making egcs work for the Linux kernel.

    --
    Aaron Sherman (ajs@ajs.com)

  91. egcs/gcc/pgcc ...? by linuxlover · · Score: 1

    Can some one please enlighten me about those 3 variations and their status? I assume EGCS and PGCC are integrated into GCC 3.0?
    Is that right?

    LInuxLover

  92. how can I keep two versions of gcc.. by linuxlover · · Score: 1

    without any conflicts or not having my system hosed.

    1. Re:how can I keep two versions of gcc.. by joto · · Score: 2

      By setting your environment variables properly, so that you only use one at a time (and needs to run a shell alias each time you want to switch the compiler you use)

      But really, that is only nessecary if you use a prebuilt compiler by someone else. If you download the source and read the build instructions you will see that it is no problem at all. I don't remember any details, but it was definitely not an issue last time I experimented a bit with the gcc source (as an expirement in using it as a backend for my own toy language, but gcc turned out to be much too difficult for a toy language :-)

  93. Some tests and problems with gcj by kahunak · · Score: 1
    I've downloaded and compile it (bootstrap), and I'm now doing some tests, it compiles the glibc-2.2.3 without problems, the same for XFree86-4.1.0 (with just one problem with the file makekeys.c), but gcj is not working for me. If I compile a really simple helloworld.java file and then try to execute it as native ELF code it just segfault. If I make gcj generate the .class files and then run it with kaffee java command it does work.



    Anybody knows how to fix it?



    - german

  94. Press release available by bkuhn · · Score: 4

    For those of you who prefer a non-hacker announcement of the release, a press release is available.

  95. A warning before you start installing by ManOPiano · · Score: 1

    binutils 2.11, the latest version, and prior releases are *incompatible* against gcc 3.0.

    Wait until binutils 2.11.1 is released either tonight or tomorrow. Install that, then compile gcc.

    Compile Mozilla from CVS with gcc 3.0 and you'll notice how amazingly fast it is!

    Cheers,
    Ghadi Shayban

  96. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by throx · · Score: 2

    Which is why I always code these sort of loops as:

    int i;
    for (i = 0; i < x; i++) {
    ...
    }
    for (i = 0; i < x2; i++) {
    ...
    }

    Just to avoid problems on either compiler.

    Just to avoid problems on either compiler.
    --

    Fear: When you see B8 00 4C CD 21 and know what it means

  97. its all quite unambiguous... by thogard · · Score: 1

    the scope of anything in C is defined inside the {} set or the semi-implied {...} that contains the whole program. Some early C compilers would gernate a new frame with every {. some embeded compilers still do.

    So the int i should be in the outside scope.

    But...
    for(a;b;c) {x;};
    is the same as:
    a;
    while(b) {x; c;}
    so the int i should be in the inside scope.

    does that clear it up in an unambiguous way?

    I'm glad you see it my way (what ever that is)

    1. Re:its all quite unambiguous... by Entrope · · Score: 2

      > So the int i should be in the outside scope.

      No version of the C language allows a declaration in the middle of a block (i.e. between two statements), although C++ does. Your explanation assumes that such a thing is permitted in C.

      C99 specifically addresses how constructs like "for (int i=0; i10; i++) STMT" should be handled; it specifies that the compiler should treat it as if there were a new enclosing block around the "for ... STMT" that began with the declaration of the variable(s) in the init-part of the "for" loop.

      So C99 says that:
      for (int i=0; i10; i++) STMT
      should be transformed to act like (in older C standards):
      { int i; for (i=0; i10; i++) STMT }

      C99 makes it unambiguous indeed.

      (I can't speak towards the ISO C++ standard, but I would imagine that they also stipulate that the scope of the defined variables ends after STMT above.)

    2. Re:its all quite unambiguous... by akihabara · · Score: 1

      It's illegal because you forgot the } and }.

    3. Re:its all quite unambiguous... by he-sk · · Score: 1

      This is perfectly legal, just try it out yourself.
      #include <stdio.h>

      int main()
      {
      int i;
      i = 2;
      {
      int i;
      i = 4;
      printf("i in inner scope: %d\n", i);
      }
      printf("i in outer scope: %d\n", i);
      return 0;
      }

      --
      Free Manning, jail Obama.
    4. Re:its all quite unambiguous... by joto · · Score: 2
      "They" (the standardisation committee) didn't. However, some early C++ compilers did. VC++ and pre 5.x versions of Sun Workshop at least. Maybe also some old gcc versions (I even think the ARM recommended it, back in the days when it described what most people called C++)

      This made somewhat sense in that declarations in one scope should last until the end of that scope, so it made the language simpler (for compiler writers (not users)), but it was definitely wrong in the sense that it wasn't very useful.

      In summary: The standard got it right, and the original poster got it backwards.

  98. Performance increases in final code? by hattig · · Score: 3
    Has anyone done any performance metrics using code generated by the "all new singing dancing x86/PPC/ARM backends"?

  99. Re:no binaries? by greenrd · · Score: 1
    You download a C compiler binary. DUH.

  100. Re: Speedup by Hard_Code · · Score: 2

    My purely speculative guess is that there should even be speed up in non-natively compiled code (code *you* write), because the entire core API can be natively compiled, as opposed to being in Java itself (as Sun's is). This would mean you wouldn't break WORA, but once you flip the native toggle on the GCJ runtime, you should see vast improvements in speed.

    --

    It's 10 PM. Do you know if you're un-American?
  101. Re:GJC! GJC! by ncaustin · · Score: 1

    " I've written in clean, attractive Java code (to do stuff like rename files"

    er you wrote a Java program to rename files?
    The best think about Java for Linux developers
    is that we can get access to programs that
    previously would have been only been Windows binaries.

    GJC does not help that at all. I for one won't
    be using it, the JDKs are faster enough for me
    and I do more than rename files!

  102. Linux kernel by chrysalis · · Score: 2

    Is it safe to compile the Linux kernel with GCC 3.0 ?

    --
    {{.sig}}
    1. Re:Linux kernel by chrysalis · · Score: 3

      I've got some troubles with the newly compiled kernel. Sometimes, the kerboard blo

      --
      {{.sig}}
    2. Re:Linux kernel by HuruRudo · · Score: 1

      Well, I have successfully compiled the kernel...
      I haven't seen so many oopses before. :-P

  103. Plans are for 3.1. by devphil · · Score: 2

    There are some patches and plans for this, but they were put on hold until 3.1.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  104. Not just the name-mangling algorithm, either. by devphil · · Score: 2


    My girlfriend just asked me this question. Here was my answer:

    An ABI for a platform/language/environment combination specifies things like the byte sex, the location of certain global variables (global offset pointers, etc), which registers are used for passing parameters during a function call, whether it's the calling function or the "callee" function that saves and restores register contents during function calls (and which registers can be ignored), the order of parameters passed on the stack... basically all the things that have to be agreed upon at the bitwise level in order for you to use Compiler A to make foo.o, and me to use Compiler B to make bar.o, and then to be able to link foo.o and bar.o together successfully. Usually for C++ everything all had to be done with the same compiler because there wasn't an ABI that everyone could agree on. Now various vendors can use various compilers and this stuff will "just work" on IA-64 families.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  105. so by British · · Score: 4

    So how did they compile the first version of the GCC compiler? Seeing is that there was no prior GCC compiler first?

    1. Re:so by alannon · · Score: 3

      This reminds me of the currently popular theory of how life arose, by simply taking constituant elements, heating them up and zapping them with lightning until they form amino acids and eventually proteins.
      My theory, however, involves a freak accident involving a cage full of monkeys, a box of hand-held hole-punchers, a large stack of stiff paper and a punchcard reader.

    2. Re:so by rsw · · Score: 2

      A specific and interesting example, from a talk Dennis Richie gave a while ago:

      Imagine that you want your compiler to support a "vertical tab" escape, '\v'. When you write the compiler, you'll have some statement somewhere that reads a character and decides what to do with it, and in that statement you'll have something like:


      case '\v':
      printf(0x0B);


      Compile this code, and suddenly your compiler can recognize the vertical tab character. Now, since it can, you can simplify the above code. You modify it to:


      case '\v':
      printf('\v');


      You compile this code with your new compiler, and, because you can recognize the '\v' character escape, everything works. Now you can just replace the original source with the above source and, using your compiler, it will compile. Strangely enough, however, nowhere in the source is it evident that '\v' == 0x0B!

      This can be applied in nefarious ways, as well. Let's imagine that I want to install a back door in the 'login' program. I can write the code to give 'login' a backdoor, but a code audit will show that it's there. Instead, I can modify the C compiler so that when it recognizes that it's compiling 'login' it will modify the code to have a backdoor. However, as above, an audit of the C compiler source will show that this is going on.

      The solution? I modify the compiler such that when it recognizes that it is compiling a compiler, it adds in the code the recognizes the 'login' binary being compiled and adds a backdoor, and the code the recognizes a compiler and makes it modify compilers in the proper way. Then I compile the new compiler and replace the code with the old, unmodified code.

      Now anyone can audit the source code for the compiler and find that it's perfectly clean. If they compile it on the system with the modified compiler, however, their compiler will have both the 'login' backdoor and will make compilers that have the backdoors included. All from clean source.

      The moral of the story? It doesn't matter how trusted your source is, you always place an implicit trust in lower level utilities unless you're writing opcodes for the processor directly (and even then, a processor microcode virus isn't so far-fetched that you can completely disregard the risk). That's why your C library and your compiler, while seemingly unrelated to system security, are actually a critical part of your system's integrity.

    3. Re:so by Dirtside · · Score: 2

      Wait... is the monkey-puncher theory your theory of how life arose, or of how gcc arose?

      --
      "Destroy science and religion. Science would re-emerge exactly the same; but not religion." - Penn Jillette, paraphrased
    4. Re:so by gdr · · Score: 1
      So how did they compile the first version of the GCC compiler? Seeing is that there was no prior GCC compiler first?
      It's compilers all the way down!
    5. Re:so by langed · · Score: 5
      Of course, they did the same thing that is done in the first stages of building gcc as a cross-compiler: build a compiler that compiles the compiler you'll eventually use. This early-stage compiler need not support all of C, only the parts that the compiler uses.
      if you look in this Makefile, you'll see that in stages one and two it builds a program called xgcc, which it later deletes, but not before it compiles your cross-compiler.

      the nice thing about doing this is that the compiler that is finally built when the entire compilation process is complete doesn't have to necessarily be "real C" in the source code. It could be a nice intermingling of any number of languages. It isn't, but it does give them that freedom.

      So to review:
      gcc (installed) -> xgcc -> new gcc compiler

    6. Re:so by TeknoHog · · Score: 5
      The first GCC compiled itself. There is nothing contradictory here since, according to Novikov (see his book The River of Time) the present can be affected by future events.

      This process is somewhat similar to the beginning of the universe, which according to Perl zealots started when tiny bits of eval() statements arose from quantum fluctuations. These immediately produced more and more eval()s, resulting in a big bang of code. Eventually, other functions appeared, forming the Universe as we know today.

      There is also a controversial theory which asserts that the first GCC was written with assembler, and that the first assembler was written in binary code by Real Men (TM), but the evidence for this is questionable.

      --

      --
      Escher was the first MC and Giger invented the HR department.
    7. Re:so by amitv · · Score: 1

      The very very first GCC was compiled by whatever standard (and *gasp* proprietary) C compiler was available on the OS it was developed on. The very very first C compiler ever had to have been written in another language. Fortran, or assembly maybe.
      ---
      Can you imagine a beowulf cluster of theese?

      --
      Can you imagine a MOSIX cluster of these?
    8. Maybe Mel wrote the first gcc in hex in his head.

    9. Re:so by BlowCat · · Score: 1

      GCC can be compiled with other C compilers, unlike most stuff you can find on FreshMeat. GCC still uses K&R syntax for the code that is used in the bootstrapping process.

    10. Re:so by Evil+Grinn · · Score: 1
      A specific and interesting example, from a talk Dennis Richie

      I am sure that I only one of dozens of people to post this, but it was Ken Thompson.

      http://www.acm.org/classics/sep95

    11. Re:so by jhantin · · Score: 1
      There are lies, there are damn lies, and then there are statistics. (sorry, can't remember the guy who said that)

      IIRC that was Benjamin Disraeli, a British Prime Minister, though not in those exact words.

      "There is no act of treachery or meanness of which a political party is not capable; for in politics there is no honour." -- Benjamin Disraeli, "Vivian Grey"

      --
      ...when you're writing a game...tweak the difficulty of "Easy" to something [your mother] can cope with. -- onion2k
    12. Re:so by soya · · Score: 1

      And with natural selection the fittest monkey indeed survived.

      --


      NEVER voluntarily put a project you work on under the GNU umbrella, -- Ulrich Drepper
  106. Re:Umm by chmouel · · Score: 1

    Ever heard about compat-* package ?

  107. Re:My informal benchmark... by Dwonis · · Score: 2

    Does Jikes do array bounds checking by default? If not, then there's not really much difference.
    ------

  108. Re:how much stuff with this break? by Velox_SwiftFox · · Score: 1
    Well, you can't expect everyone else to write special stuff to support Redhat's poor choices, can you?

    They, and anyone choosing to use Redhat, have only themselves to blame if there are problems.

  109. Re:how much stuff with this break? by Velox_SwiftFox · · Score: 2
    Troll? How is this a troll? Sorry, I'm confused, I thought was just common sense.

    And it is the policy of the gcc developers, isn't it, and the developers of the linux kernel itself that Red Hat had to also supply their "kgcc" secondary system-space compiler for?

    Or is there someone out there who thinks the people are obligated to support the "gcc-2.96-REDHAT" stuff?

  110. Re:how much stuff with this break? by Velox_SwiftFox · · Score: 2

    That's what I said.

  111. Red Hat's problem... by Velox_SwiftFox · · Score: 4
    So... since Red Hat jumped the gun and grabbed development releases using libs that apparently gcc will no longer be compatable with - and according to what they've said is their policy that they won't change to incompatable libs in mid-major-version - I wonder if this means RH 8.0 will come out simultaneously with 7.2, or if they are going to just skip now to 8.0?

    Or if Red Hat users will now be forced to continue to use what has become obsolete software?

    1. Re:Red Hat's problem... by Goldberg's+Pants · · Score: 2
      No, that would be Debian.

      ---

    2. Re:Red Hat's problem... by cnkeller · · Score: 1

      From the seawolf (RH 7.1) mailing list about five minutes ago... "Edward S. Marshall" writes: > An interesting question, though: can anyone with more information at hand > than me say whether or not ABI compatibility was maintained between Red > Hat's 2.96 and the final 3.0? For C++, gcc 3.0 isn't compatible with our 2.96RH, 2.95.x, 2.8.x, egcs or anything else. It's only compatible with itself. -- Trond Eivind Glomsrød Red Hat, Inc.

      --

      there are no stupid questions, but there are a lot of inquisitive idiots

    3. Re:Red Hat's problem... by Erasmus+Darwin · · Score: 5
      Or if Red Hat users will now be forced to continue to use what has become obsolete software?

      The existence of a new version of software does not (unless you're dealing with the ugly, ugly world of MS Office documents and their lack of backwards compatibility) automatically break older versions. You will not go bald, get cancer, or get attacked by a pack of rabid dogs just because you're using an older version of gcc. You will not see:

      [erasmus@localhost ~]$ gcc -o test test.c -Wall
      gcc: Version 3.0 has been released. You must upgrade. Sorry.

      Furthermore, from the Slashdot blurb (right at the top of the page -- you don't even have to click a link), we've got the following:

      Plans for 2.95.4 (bugfix release), 3.0.1 (bugfix release), and 3.1 (more user-visible features) are all in progress.

      In short, the 2.9x line (which Redhat admittedly bastardized a bit by grabbing a snapshot and calling it 2.96) will still be fixed for bugs.

      Also, for a production system, new, untested code is considered unacceptable. There are bugs in the 3.0 version of gcc, period. Over time, they will get fixed. But just like running an experimental kernel (or even the very first new stable release of a previously experimental kernel) is a great way to shoot yourself in the foot, you don't want to jump to gcc 3.0 unless you've got a reason to use it. And people who have a reason will generally be able to locate and install a copy of gcc 3.0, anyway. Hell, give it a few weeks and they should be able to locate and install an RPMed copy of gcc 3.0. And I'm sure there are people out there who will need gcc 3.0 -- it just won't be the core Redhat demographic, yet.

      In short, did the people at work bitch at me for running RedHat 6.2 on our production machines at work? No. Would they have bitched if I had upgraded to 7.0 when it came out, broken things in the process, and used the excuse that they just need to wait a year for RedHat 7.2? Hell, yes. Even Slashdot does something similar -- there's plenty of lag between the latest version of Slashcode and what's running on Slashdot.

  112. x86 performance? by be-fan · · Score: 2

    How does the new x86 backend generated code perform in relation to previous compilers. I know icl (Intel C compiler) is coming out for Linux, and from the demoes of it I've used on Windows, it looks pretty damn spiff. (Stupid 30 limit...) Compile speed is fast too. If you look at the icl docs, you'll find that the optimizer on this thing is insane, it does all sorts of inter-intra function optimizations and prepiplines code and everything. I have only a vague understanding of what the hell that means, but it sure SOUNDS fast. Anyway, I'll try out the Windows version and see how it performs in relation to gcc. I'll post benchmarks when I get the chance. I'd appreciate it if someone would post Linux benchmarks as well, because as much as I like Windows, I can barely stand not having bash. (Ah... BeOS, where art thou?)

    --
    A deep unwavering belief is a sure sign you're missing something...
  113. Comment removed by account_deleted · · Score: 1

    Comment removed based on user account deletion

  114. Here's the funny thing... by bconway · · Score: 5

    Guess what? Everyone that complained about GCC 2.96 being broken (and not reading http://www.bero.org/gcc296.html) despite the fact that their code wasn't C99 complient STILL WON'T COMPILE. Now you can't complain that your code won't work because it's a developmental compiler, you'll actually have to fix it. Numerous examples of this are listed at the above URL, I'd highly suggest you try it out. I have a feeling quite a few people are gonna be red in the face over this one. ;-)

    --
    Interested in open source engine management for your Subaru?
    1. Re:Here's the funny thing... by Karellen · · Score: 1

      Thing is, it's never been part of a recommended spec. the tag was introduced as part of HTML3, with the "size" attribute and I think one other, but not "face".

      However, when they deprecated it in HTML4, they still added the "face" attribute!?! WTF? Why add features to something you're deprecating? If it's going to be obsolete, and you're discouraging use of it, surely adding features will just encourage people to use it. Madness.

      --
      Why doesn't the gene pool have a life guard?
    2. Re:Here's the funny thing... by Karellen · · Score: 2

      Huh? IIRC, the ANSI standard, which was later adopted as the ISO C standard with no changes apart from section numbering, commonly known as C89, requires that comments are replaced by a single space, making the /**/ token splicing specifically not work if you were using your compiler in a strictly conforming mode.

      (Although a number of compilers still provided a non-strictly-conforming 'traditional' mode which would allow such constructs, along with various other bits and pieces that we (and our code) had all got used to)

      K.

      --
      Why doesn't the gene pool have a life guard?
    3. Re: Here's the funny thing... by bentini · · Score: 1

      Look at TeX. It is bug-free, or if it isn't, find one and Knuth will give you $327.68, and then $655.36 for the next time. How come noone takes it up if there are actually bugs?

    4. Re:Here's the funny thing... by andyh1978 · · Score: 2
      And it's not such a bad thing - the face="" paramater to the font tag is invalid HTML. I guess the web in general should be red in the face?
      No, it's just deprecated in Strict in favour of stylesheets.

      Since most pages are using Transitional, it's not an issue.
  115. Re:partially correct (HP-UX) -you need a K&R compi by akihabara · · Score: 4

    AFAIK, gcc requires a *K&R* C compiler, as documented in the first edition of The C Programming Language. It need not support function prototypes or the void type (I think).

    No, it does not require such a compiler; it is required to be bootstrappable with such a compiler.

    And K&R did have void. They didn't have pointer to void.

    On UNIX systems that do not natively support and include gcc, one uses the system's C compiler to generate xgcc, which is GNU C (but not compiled by GNU C).

    Not really. xgcc is the name of the result of the stage1 and stage2 bootstraps; the stage2 one is created by the stage1 one (i.e. by GCC).

    I don't know why xgcc is not normally installed and used

    It effectively is, if you type "make install". The bootstrap process just ensures that the result of the stage3 bootstrap has identical object files as the result of the stage2 bootstrap, which formed xgcc. In other words,
    that optimized GCC compiles itself into the same optimized GCC - a consistency check. Those binaries are what get installed, so it is effectively the same GCC.

    but I assume that it would be an ease-of-debugging issue (and you can also debug gcc-optimized code, which most vendor compilers will not do).

    Nothing to do with it. Everything after stage1 is a consistency check.

  116. Re:Question by selectspec · · Score: 5
    --

    Someone you trust is one of us.

  117. In 100 Words Or Less Describe ABI by EXTomar · · Score: 2

    From my lazy and half hearted poking around GCC's web page I didn't find information on ABI let alone why it is important to put in the compiler/compiled binaries. So what is ABI and why should people using the 3.0 compiler care?

    1. Re:In 100 Words Or Less Describe ABI by Karellen · · Score: 4

      ABI == Application Binary Interface.

      It's the format for putting things like function names in object files so that the linker, when fixing up function calls across object files, can match the call with the correct function.

      While this isn't a problem in C (just use the function's name for christ's sake), C++ allows overloaded functions; multiple functions with the same name but different parameter lists. For the linker to match the correct call to the correct function, the parameter list needs to be munged into the function name stored in an object file.

      The new way of doing it is generally less clunky and takes up less space in your object files than the old way. But is incompatible with it. :(

      (Note that this only matters where GCC is being used as a native compiler to compile files that only need to be linked with each other. If compiling for a platform where gcc is not the native compiler (e.g. using GCC on, say, solaris, alongside the default compiler) you need to use the ABI defined for that platform to allow your object files to be linked with all the other object files you have that were compiled with the native compiler.)

      Yeah, it's more than 100 words. Sue me :)

      --
      Why doesn't the gene pool have a life guard?
  118. The GCC developers should thank RedHat by kdgarris · · Score: 5

    The fact that RedHat used an earlier snapshot of this compiler allowed for extensive testing early in the development process, resulting in many bug-fixes being made to the snapshot as well as to the pre-3.0 GCC development code.

    I'm sure this release came about sooner with a lot less bugs due to Redhat's move to use the earlier snapshot in their distro.

    -Karl

  119. no binaries? by willie150 · · Score: 1

    So assuming that you don't have a built compiler (and thus require GCC)... what do you do? This is the only thing that I can understand needing binaries for, and it there isn't any. This don't make sense to me.

    --
    Better to stay silent, and let people think you're an idiot than to open your mouth and remove all doubt
    1. Re:no binaries? by willie150 · · Score: 1

      So which part of "So assuming that you don't have a built compiler" dont you understand? And gcc comes with it's own compiler (also not built), just to compile the compiler. funny actually.

      --
      Better to stay silent, and let people think you're an idiot than to open your mouth and remove all doubt
    2. Re:no binaries? by Salsaman · · Score: 2
      Well you build gcc 3.0 with gcc 2.x, and then you use your newly built gcc 3.0 to build gcc 3.0 again.

      Simple really.

    3. Re:no binaries? by Salsaman · · Score: 2
      There are binaries of gcc 2.x

  120. Re:My informal benchmark... by DrCode · · Score: 2

    I believe it does. Jikes (which I haven't used for about a year) was a quite amazing piece of code. The compiler itself was blazingly fast, and gave excellent error messages.

  121. My informal benchmark... by DrCode · · Score: 3
    I tried GCJ about a year ago with a large parser I'd written in Java. It was a pure command-line program, with no GUI at all, and I compared a GCJ-compiled version with one compiled and running with IBM's Jikes compiler/JRE.

    To my surprise, the Jikes version ran much faster, about 2X, than the native code. Only when I recompiled with GCJ with the option to skip array-bounds-checking, did the native version run at about the same speed as Jikes.

  122. Re:how much stuff with this break? by teg · · Score: 2

    It was a snapshot, which was then QAed and patched selectively for some time before release - it was better than any other alternative at the time, as the compiler we shipped before was rather old, and 2.95.x was buggy. We also got support for IA64, so we didn't have to use lots of different compiler for different architectures.

    The only thing wrong about what happened, was that we didn't properly communicate that this was a Red Hat, not an FSF, release. Other than that, it showed the power of free software by allowing us to do what we felt was needed and not being locked in- nothing wrong about that. It has served us well for two releases now - in the future, we will eventually move to gcc 3.0(.x?), but this was obviously not an available compiler back then.

    PS: Since our initial release, Mandrake has done the switch as well.

  123. No Binaries? by Tungz10 · · Score: 1

    It's a C++ compiler and all that's released is C++ source.

    So how the hell are you supposed to use it? Of course, most of us just happen to have binaries of a previous version but still...

  124. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Harri · · Score: 1

    The C++ standard specifies that the for scope ends at the end of the for loop. The only compiler I know of that gets this wrong is Visual C++. That is a bug with Visual C++ and will be fixed in 7.0 AFAIK.

  125. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Harri · · Score: 3

    This post lists the non-compliance issues that VC7 will ship with. The for-loop scoping problem isn't there.

  126. Twiddling my thumbs by andy@petdance.com · · Score: 2
    If ever there was a piece of software where I want to wait until the .01 release, this is it.

    Normally, I'll snag most anything off the server to live on the bleeding edge, but not this time...
    --

  127. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by marble · · Score: 1

    Actually, MSVC has a command line switch that turns on the correct behaviour (that i goes out of scope at the end of the loop). It's just that if you turn it on it can't compile it's own headers, so it's somewhat useless...

  128. Re:pragmas by marble · · Score: 1
    On XYZ C++ #pragma once means to overwrite your bootsector once. XYZ C++ documents this, and is therefore a standard conformant compiler.

    #pragma is evil.

  129. Re:Question by marble · · Score: 3

    The C Programming language was originally standardised in 1989, and this was known as C89 (and also as C90 - long story...) In 1999, the C language was updated with some new features and library functions. This is now known as C99.

  130. Re:pragmas by marble · · Score: 3

    #pragma is evil - anything after the #pragma is implementation defined. This means that #pragma blah on one compiler might do one thing and something else entirely on another. You can't conditionally use it per compiler since it's at the pre-processor level. (You can't #ifdef out #endif, for example.) _Pragma is nicer, however, as you can do: #if <test for GCC> #define BLAH _Pragma whatever #elif <test for other compiler supporting such enlightenment> #define BLAH whatever #endif BLAH Unfortunately I don't know of any other compilers that realise this, so you're sort of stuffed. Most of them allow #pragmas to be ifdef'd out which is nearly as good.

  131. 5 points by StandardDeviant · · Score: 3

    a) printf statements and I/O inside loops in a performance benchmark? hello, McFly... you aren't really testing the compiler there.

    b) gcc only as source??? (see your installation media for any free unix to get binaries, cygwin for win32, etc. etc. GNU may only distribute source but other folks can and do distribute binaries, and I'm sure gcc 3.0 binaries will be released for your platform of choice Real Soon Now)

    c) FP perf: what do those numbers mean? There is no explanation given of how they're arrived at or what scale they're on. "Naked numbers unlike naked ladies aren't terribly interesting."

    d) Ease of Use/Installation: Totally subjective and totally irrelevant to the merits of the compiler. Just because a preteen could install VC++ doesn't make it's code any better.

    e) "overhyped","not ready" gcc: ok, so you're a troll. Just try not to be flaming stupid while you're at it. If it isn't ready then why is the operating system I'm using to type this reply on built with it? Is gcc the best compiler ever, well, no, there's no such thing. Frankly I wish gcc supported something more recent in the fortran family than F77 (not that I like Fortran per se but as a scientific coder it's sort of common and stuff).


    --
    News for geeks in Austin: www.geekaustin.org
    1. Re:5 points by gregoryl · · Score: 1

      GNU may only distribute source but other folks can and do distribute binaries

      As a security analyst I feel the need to stress only get binaries from a reputable site. A compiler is the perfect place to hide a trojan (passing it on to everything you compile ... network apps ... running as root). A brand spanking new version of a compiler generates a very nice amount of comotion to entice people to download the trojaned compiler.
      Be careful!

  132. Re:Question by RevAaron · · Score: 5

    What is Google?

    --

    Working toward a usable PDA environment in the spirit of Newton OS: Dynapad
  133. Re:Umm... by istartedi · · Score: 4

    No matter how good your QA process, the chances of catching and squashing every single bug before release are minimal

    Unless you're Microsoft; then you're an incompetent, obnoxious, FUD-spouting dinosaur and every bug that escapes is an indictment of you, your business practices, design methodology, family heritage, preference for breakfast cereal, haircut and anything else associtated with you or anyone you have ever met, slept with, laid eyes upon, or casually passed on the street.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  134. g++ 3.0 compilation speed by martinde · · Score: 3

    Did they manage to speed up g++ at all? In the prerelease versions, I was seeing compilation times that would put g++ 3.0 at about 2-3 times slower than 2.95.2. And 2.95.2 was significantly slower than any egcs version. Anyone know if there are plans to address this?

    1. Re:g++ 3.0 compilation speed by tie_guy_matt · · Score: 1

      Stupid question:

      I thought the point of a good compiler was to speed up the run time performance. If compiling a program now takes twice as long but the resultant binary is now 30% faster wouldn't that be a good thing? And if fast compilations are important aren't there optimizers etc that you can turn off?

    2. Re:g++ 3.0 compilation speed by NoOneInParticular · · Score: 1

      About compilation speed, does anybody know whether g++ 3 supports the 'export' keyword now? That would help quite a bit in reducing compilation time.

      And on a related note, does it still need approximately 2 Gigs of internal memory and the better part of the weekend to optimize heavily templatized code*?

      Thanx

    3. Re:g++ 3.0 compilation speed by NoOneInParticular · · Score: 1

      Ok, forget the second question, someone above mentioned that it now only takes 1 Gig and a day, sigh.

    4. Re:g++ 3.0 compilation speed by NoOneInParticular · · Score: 2

      Ok, my problem with gcc stems from the time when I moved from Windows/MSVC to Linux/gcc as my development platform. Porting the code wasn't difficult, what was really bugging me was that compilation time for the project I was working on increased from 30 sec. on MSVC to more than 5 mins. using gcc. This was with full optimizations.

      The libary I'm currently working on is heavily templatized and I need at least 256 Mb of RAM to be able to compile it using -O1, let alone -O2. Even with massive amounts of RAM (about 2 Gigs), the compile cycle takes ages. The same library compiles in a breeze using MSVC (factor 20 faster) and to top it off --- MSVC generates faster code!

      Luckily we can discount MSVC because it also was routinely capable of generating extremely fast code that was absolutely wrong!

      So, yes there is at least one optimizing compiler that is way faster than gcc. Maybe MSVC cut a few corners doing this (plus being far from standard compliant), but it sure seems possible.

    5. Re:g++ 3.0 compilation speed by tim_maroney · · Score: 2
      I thought the point of a good compiler was to speed up the run time performance. If compiling a program now takes twice as long but the resultant binary is now 30% faster wouldn't that be a good thing?

      That's one point of a good compiler. Another point is to improve programmer productivity. If the "free" compiler is ten times slower than the commercial compiler (as the poster above stated in comparing GCC to MSVC), then it only takes a few weeks at most for the loss in programmer productivity from excessive wait times to more than cancel out the cost savings up front.

      And if fast compilations are important aren't there optimizers etc that you can turn off?

      Yes. The ordinary compile-link-run-cycle should disable optimizations for this reason. But that doesn't mean GCC in this fast mode will outperform CodeWarrior or MSVC in their own fast modes. I would like to see some competitive benchmarks.

      Tim

    6. Re:g++ 3.0 compilation speed by statusbar · · Score: 1

      The (almost) ultimate test of a c++ compiler with templates is the blitz++ library at http://www.oonumerics.org/blitz/

      I wonder how well it works with g++ 3.0?

      --jeff

      --
      ipv6 is my vpn
  135. FOR loops: a question, ANSI C++, C++98, C++99.... by MrMeanie · · Score: 2

    Certain compilers, including previous releases of GCC and Metrowerks Codewarrior allowed the following:

    for (int i = 0; i x; i++)
    {
    [....]
    } //scope of int i ends here so....

    for (int i = 0; i y; i++) //...redeclaring int i doesn't blow up
    {
    [....]
    }

    Does GCC 3.0 still allow this?
    The above code 'feature' is not allowed under the ANSI C++. Under ANSI C++, the int i variable scope will continue beyond the for loop. IMHO the ANSI standard does not make sense WRT this issue. This is commonly thought to be a bug in the ANSI C++ spec (or so I am led to believe).
    I do not know about C++ 98/99/whatever standard. Any URLs anyone?

  136. Re:GJC! GJC! by dmelomed · · Score: 1

    "GNU TOOLS FOR LINUX: BECAUSE LINUX USERS HAVE A RIGHT TO CLEAN, ATTRACTIVE, EFFICIENT OBJECT ORIENTED CODE, TOO."

    First GCJ is not for Linux only. Second compiling Java to native machine code does not guarantee performance improvements, and memory consumption could be even worse than for a JVM (I tried a famous object to native code compiler on NT, the memory consumption was at least twice as much for an application compared to just JVM).

    Just like with any language Java code is not always clean and attractive. Java does not guarantee clean and attractive code. Nor does any other programming language.

    <FLAME> And since when do object oriented and efficiency go together? Just look at Mozilla or KDE for example. Bloat, bloat, bloat. </FLAME>

  137. Re:Question by bigdavex · · Score: 1
    C99 is an update to straight C-standard. It picks up a few features of C++ (e.g. // comments) and general mishmash. Much of it is already supported by modern compilers.

    Kuro5hin ran a story on this.

    --
    -Dave
  138. ISO C++ limits scope to the loop by jdennett · · Score: 1

    The code you posted is legal (modulo the missing signs). The only current compiler I know which doesn't think so is MSVC++ 6, which is so far from the C++ Standard as to be a joke.

    Why you think there's a problem with the Standard is a mystery to me. It's well-defined, and has been for years. There's no controversy.

    g++ has a feature which allows broken code which assumes the old rules (extended scope) to work with a warning, but it always prefers the new, Standard rules.

  139. No export in *any* C++ compiler yet by jdennett · · Score: 2

    It's the last of the Standard features to fall. Comeau C++ is allegedly close, predicting that their compiler will support export before the end of the year, but I haven't heard anything on the gcc developer's mailing list about g++ supporting export anytime soon.

  140. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by cant_get_a_good_nick · · Score: 1
    This is controlled on the command line with -ffor-scope and -fno-for-scope. This has been around for a while (at least since 2.8.1 days) when the spec wasn't that firm on this (in fact gcc's default has changed).

    see Options Controlling C++ dialect in the manual.

  141. Re:how much stuff with this break? by cant_get_a_good_nick · · Score: 1

    The gcc 2.96 stuff was a RedHat-only f.u.b.a.r. mess. They took a development snapshot, called it 2.96 and released it to an unsuspecting public. Don't blame the gcc folks for RedHats probably very unwise decision.

  142. Re:Umm... by Karn · · Score: 2

    Why would a groups plans to fix a .0 release spook anyone? Who do you know that released a .0 verison of something and didn't have bugs?

    --


    Why do I keep typing pythong?
  143. You will not go bald, get cancer, ... by The+Gline · · Score: 1

    "...or get attacked by a pack of rabid dogs just because you're using an older version of gcc."

    Rats. There goes my idea for one HELL of a denial-of-service.

    --
    Honorary Member of Jackie Chan's Kung Fu Process Servers
  144. insert Homer-donut sound here by pizen · · Score: 1

    gcc...yum
    ---

  145. Solaris? by 11223 · · Score: 1

    Does the new C++ ABI affect solaris? Will my KDE/etc. stop working if I update from 2.95.3 to 3.0?

  146. i wonder... by athlon02 · · Score: 1

    that's kewl that there's an hc11 and hc12 port now, since those are some nice little microcontrollers... i wonder how easy/hard it would be to port it to other hc## chips, anyone know? i mean would it be just a matter of using the hc11 or 12 port as a template and swapping a few opcode names & values and recompiling? (since i've never gone as far as constructing a full fledged compiler, just some simpler parsers).

  147. Multi language by marcovje · · Score: 1


    I see language changes (Java integrated, Fortran improvements), but I kind of miss the years old Gnu Pascal project?

  148. From the GCC 3.0 Caveats by wmulvihillDxR · · Score: 1

    The Chill compiler is not included in GCC 3.0, because of the lack of a volunteer to convert it to use garbage collection.

    As in, "Chill, to the next episode/version"

    --
    Check out Althea for a stable IMAP email client for X. Now with SSL!
  149. Are you mad? This isn't Java! by mactari · · Score: 1

    This is Java 1.0 at its worst -- this is not some magic box (yet) that takes your Java 1.3 app and makes it native.

    Here are some quotes from the gcj FAQ, just for context.

    > What Java API's are supported? How complete is the support?
    >
    > Matt Welsh writes:
    > Just look in the 'libjava' directory of libgcj
    and see what classes are there.
    > Most GUI stuff isn't there yet, that's true, but many of the other classes are easy to add if they don't yet exist.
    ...
    > Considering that AWT support isnt here yet there is no chance of getting Swing running.
    > Once we have AWT support the Swing 1.1.1 may be useable and even redistributable,
    > but JFC will be another issue...

    This quote means that we're talking Java 1.0. Don't bother asking about Java3D yet! :^D
    > GCJ supports all Java language constructs as per the Java language
    > Specification v1.0
    . Recent GCJ snapshots have added support for
    > most JDK1.1 language features, including inner classes.

    (bold mine, natch)
    Looks like "faceless" apps should compile, but don't expect much else.

    So check out... gcj FAQ
    the gcj site
    ... before getting too excited! ;^)

    For more info on AWT and gcj, check out the peerlib work. Not much has happened in a while from the looks of it.

    So gcj might be integrated with gcc, but as any two-bit Java programmer like myself can tell you, this ain't my Java. This is several generations behind any other platform. You'd be writing code for the absolute lowest denominator, using deprecated methods in today's Java world. You'd nearly be teaching yourself COBOL, if I can put an exaggerated spin on it. No GUI, no XML API, no Collections, no...

    Ruffin Bailey

    --

    It's all 0s and 1s. Or it's not.
  150. Re:pragmas by ebichete · · Score: 1

    > #pragma is evil - anything after ....

    What about the following, surely it's good ?

    #pragma once

  151. Time to recompile RedHat by C0vardeAn0nim0 · · Score: 1

    This time with an official release of GCC, not the broken development release they used in RH 7.0...

    --

    --
    What ? Me, worry ?
  152. Re:Umm... by oconnorcjo · · Score: 3
    The way programmers are pushed today the first x.0 is mostly more of a beta than a release.

    Actually what is happening is that as the tools we create and use become more and more sophisticated (and thus more lines of code in use), the harder it becomes to catch all the possible things that could go wrong in an application. With big projects like the Linux Kernel, GCC, Mozilla (now in beta), KDE, Gnome, XFree86- it is just realistic to assume that even though the developers worked very hard for a stable release, people will find bugs.

    --
    I miss the Karma Whores.
  153. how much stuff with this break? by kenfrid · · Score: 2

    This being the first "major" release of the gcc in years, the big question is "how much stuff is this going to break?" Are we going to have a repeat of the gcc-2.96-REDHAT fiasco? I can see it now: "Sorry, this package compiled with gcc-3.x, you appear to have a 2.95 based system, please upgrade." Or the other way around. Download a source tarball and see "this code written specifically for gcc-3.x. You need at least that version to compile."

  154. Re:FOR loops: a question, ANSI C++, C++98, C++99.. by Garen · · Score: 1

    Actually, your example is how it should be. It's not a bug in ANSI/ISO C++, and C99 adopted that behavior too. My guess is you're comparing it to MSVC6, which incorrectly allows the scope of i to be extant outside of the for block.

  155. gcj now integrated by iloveAB · · Score: 4

    I use a lot of JAVA, and it looks like we will finally have a full JAVA front-end for gcc with dependency generation (for automatic makefiles).

  156. Re:so ("Which came first ...) by fnkybuda · · Score: 1

    ... the chicken or the egg. I egged the chicken and then I ate his leg." Beastie Boys - Pauls Boutique - Eggman

  157. Re:GJC! GJC! by dasmegabyte · · Score: 2

    Sorry for the high geek quotient in the previous message, I think the five cups of coffee injested since the news of GJC have kind of warped my perception of, well, anything. In my zeal, I forgot to paste a link to this HELL LEET COOL BITCHIN SWEET ASS new GNU tool...http://gcc.gnu.org/java/.

    GNU & JAVA: The Network is the OS.

    --
    Hey freaks: now you're ju
  158. Re:GJC! GJC! by dasmegabyte · · Score: 2

    I was referring to MY code...it's efficient and object oriented, and now I can give it to you Linux chaps as well. Consider yourselves lucky.

    This ego trip brought to you by a succesful compilation of the new GCC under Mac OSX.

    --
    Hey freaks: now you're ju
  159. GJC! GJC! by dasmegabyte · · Score: 5

    GNU JAVA COMPILER!

    I can finally write in Java and not get made fun of by my elite C++ hax0r friends!

    In case you weren't aware, GCJ is the first Gnu toolset for Java, and it's not just a nasty rehash of Sun's stuff...it's JRE, JIT and NATIVE CODE COMPILER rolled into one. They have an odious refutation of the Write Once Run Anywhere creedo which I don't necessarily agree with (the guy must be writing some pretty fierce code if he's had problems like he mentions, I've done distributed Java with the Swing libraries for about a year and never had a problem that wasn't related to Netscape sucking). What I care about, though, is the speed ups. Finally, all my keen little utility programs I've written in clean, attractive Java code (to do stuff like rename files, play music and so on) will run as fast as OS level stuff. I intend on compiling the sweet ass netbeans ide as soon as they get AWT working. Maybe I'll finally be able to get it to run as fast on my shitty Celeron windows machine as it does on my MACOS lappy.

    GNU TOOLS FOR LINUX: BECAUSE LINUX USERS HAVE A RIGHT TO CLEAN, ATTRACTIVE, EFFICIENT OBJECT ORIENTED CODE, TOO.

    --
    Hey freaks: now you're ju
  160. simd? by nilstar · · Score: 1

    It's been a while since I've used GCC, does anyone know if it has inline assembly support for SSE and SSE2 on the intel side?

    --
    ===> An eye for an eye makes everyone blind - MG
  161. Question by Tachys · · Score: 2

    What is the C99 standard?

  162. Performance benchmarks? by $hotgun · · Score: 1

    So with a new ia32 back end concentrating on Pentium II performance, has anyone done any benchmarks to see what kind of improvement we can get from nothing more than a recompile?

  163. EGCS is now officially obsolete! by archnerd · · Score: 1

    Hallelujah! Praise the Lord! Woohoo!

    1. Re:EGCS is now officially obsolete! by MrRudeDude · · Score: 1

      Our user id's are only one different.

      But I haven't found the palindrome guy we both just missed, 450054.

  164. That *is* standard C++ by Anonymous+Brave+Guy · · Score: 1

    The only C++ standard is the one from 1998, ISO/IEC 14882:1998(E). The next major revision of the standard, not due for a couple of years yet but now under discussion, is currently known as C++0x.

    According to the existing standard, the for-loop scoping you showed is standard. In the following code, the variable i is in scope throughout the for-loop, but no further.

    for (int i = 0; i < 10; ++i) {
    std::cout << i;
    }

    The fact that MS haven't bothered to fix this most basic piece of functionality in their compiler by default doesn't mean that it's not standard, it just means that MS's compiler isn't standard-compliant by default. There's actually a switch you can set at the command line to change this, but of course it will break MFC, so few people who use VC++ actually use it...

    --
    If you disagree, post your argument. (-1, Overrated) isn't your personal censorship tool for views you don't like.
  165. When's It going to be Mandrake ;-) by A+Commentor · · Score: 1

    So when's Mandrake going to incorporate this into their distribution?

    With Mandrake 8.0 problems with Adaptec SCSI Controllers, I'll be staying with 7.2 until they get it fixed up and hopefully include this new compiler..

    --

    Looking for any old 8-bit Heathkit/Zenith software/hardware - http://heathkit.garlanger.com