Slashdot Mirror


GCC 3.3 Released

devphil writes "The latest version of everyone's favorite compiler, GCC 3.3, was released today. New features, bugfixes, and whatnot, are all available off the linked-to page. (Mirrors already have the tarballs.) Let the second-guessing begin!"

263 of 400 comments (clear)

  1. woo! by KrON · · Score: 5, Funny

    mmm i'll install this one only cuz it rhymes ;)

  2. gcc 3.3 fails on glibc 2.3.2 by Anonymous Coward · · Score: 4, Interesting

    just for information re-compiling glibc 2.3.2 with gcc 3.3 fails. i don't see the point releasing a compiler or standard glibc which doesn't allow the existing compiler to be used to compile it.

    1. Re:gcc 3.3 fails on glibc 2.3.2 by bconway · · Score: 5, Insightful

      I don't see the point in making changes to a compiler that shouldn't be made solely to satisfy a single piece of software. If the problem is with glibc, it should be fixed, not worked around. What if XFree86 failed to compile, should GCC work around that? How about Mozilla or OpenOffice.org?

      --
      Interested in open source engine management for your Subaru?
    2. Re:gcc 3.3 fails on glibc 2.3.2 by Anonymous Coward · · Score: 2, Interesting

      don't you think that a compiler should at least be able to deal with the last release of a core system component such as glibc ?

      The compiler should at least be able to compile a) the Kernel b) the Glibc.

      From the release timeframe a) is no problem. But b) usually takes half - one year to show up with a new release. They should at least release gcc and glibc at the same time or at least provide patches. Regardless to that the glibc and gcc people are almost the same persons so they should know best.

    3. Re:gcc 3.3 fails on glibc 2.3.2 by rmathew · · Score: 2, Interesting

      *Why* do you say that? I mean, can you point to some page that details the problems

    4. Re:gcc 3.3 fails on glibc 2.3.2 by Scarblac · · Score: 1

      Those are third party projects.

      GCC is the C compiler of the GNU project, glibc its C library. Those are the first things that should work together...

      --
      I believe posters are recognized by their sig. So I made one.
    5. Re:gcc 3.3 fails on glibc 2.3.2 by norwoodites · · Score: 3, Informative

      Try this link instead: http://gcc.gnu.org/PR8610, it is smaller and easier to remember.

    6. Re:gcc 3.3 fails on glibc 2.3.2 by jmv · · Score: 4, Informative

      Typically, all gcc releases break the kernel somewhere. This is because many kernel rely (unintentionally) on some behaviour of gcc that is not guaranteed by the standard. When a new gcc release comes, they need to make sure they fix that. That's why there's always a "list of supported compilers for the kernel". There's no reason why the gcc folks should refrain from using some optimizations because it would break bad code in the kernel.

    7. Re:gcc 3.3 fails on glibc 2.3.2 by nr · · Score: 1

      If glibc break due to crappy programmers unable to follow the ISO C standard its their fault. The glibc team should fix their buggy code, not hassle the GCC team with ugly workarounds.

      Big greets go our to all GCC developers/testers making the 3.3 release possible!

    8. Re:gcc 3.3 fails on glibc 2.3.2 by SexyAlexie · · Score: 1

      They really shagged the dog on this one..

      [alex@slut]/home/alex/src/sizetest > ./sizetest-2.95.3
      sizeof(std::streamoff) = 8 bytes (64 bits)
      sizeof(std::streampos) = 8 bytes (64 bits)

      [alex@slut]/home/alex/src/sizetest > ./sizetest-3.2.2
      sizeof(std::streamoff) = 4 bytes (32 bits)
      sizeof(std::streampos) = 12 bytes (96 bits)

      Oh dear!!

      --
      I'm too sexy for you.
    9. Re:gcc 3.3 fails on glibc 2.3.2 by norwoodites · · Score: 1

      In the release notes for gcc 3.3, there is a note about accessing PR's.

    10. Re:gcc 3.3 fails on glibc 2.3.2 by GlassHeart · · Score: 1
      This is because many kernel rely (unintentionally) on some behaviour of gcc that is not guaranteed by the standard.

      Really? I would consider that to be terrible code. It's one thing to intentionally rely on compiler quirks, because sometimes you really don't have a choice. It's another entirely to not even know that your code relies on a particular version of the compiler. An unintended portability problem is a bug, produced by a programmer who doesn't know his or her language!

      Absent proof of many portability bugs in Linux, I don't think your assertion can stand.

    11. Re:gcc 3.3 fails on glibc 2.3.2 by Arandir · · Score: 1

      But glibc is not a core system component of any system other than Linux (and the semi-mythical Hurd/GNU).

      GCC-3.3 will compile the kernel and libc on my Free Software operating system, so it's no problem for me.

      --
      A Government Is a Body of People, Usually Notably Ungoverned
    12. Re:gcc 3.3 fails on glibc 2.3.2 by stephenb · · Score: 1

      libstdc++ != gcc

    13. Re:gcc 3.3 fails on glibc 2.3.2 by SexyAlexie · · Score: 1

      You can't build C++ apps with large file support in GCC 3+. Not good.

      --
      I'm too sexy for you.
    14. Re:gcc 3.3 fails on glibc 2.3.2 by jmv · · Score: 4, Informative

      It's not necessarily someone who doesn't know the language. Sometimes "normal" mistakes happen and don't get corrected because nobody noticed (i.e. because the compiler generated code that didn't expose the bug). Alan Cox once said that if you don't have access to a big endian machine, there's no way your code will work perfectly on such machine (though you can come close, you'll always miss one). The same is true with compilers: unless you have a compiler that generated bad code for 100% of the cases where you're not following the language perfectly, you won't catch all bugs.

      Most of the times, this is not obvious stuff. A while ago, gcc 2.95 (or was it 2.96?) broke the kernel because of the strict aliasing rules: gcc assumes that an (int*) and a (float*) can't point to the same area (even now, the kernel needs to be compiled with -fno-strict-aliasing). One of the reasons why gcc 3.3 breaks the kernel now is that at some places, the kernel assumes that an inline function will be inlined, otherwise it breaks. The older versions of gcc always made those functions inline, but the new version take inline merely as a hint (like "register"), which is compliant with the standard. The kernel needs to be fixed to say "inline this or die" or something like that instead.

    15. Re:gcc 3.3 fails on glibc 2.3.2 by p3d0 · · Score: 1
      older versions of gcc always made those functions inline, but the new version take inline merely as a hint (like "register"), which is compliant with the standard.
      Really? That's a shame. One of the things I used to like about gcc is that it would bloody well inline something if I told it to. I once had an application that ran 10 times slower with Intel's compiler because it didn't inline what I told it to.
      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    16. Re:gcc 3.3 fails on glibc 2.3.2 by GlassHeart · · Score: 1
      It's not necessarily someone who doesn't know the language. Sometimes "normal" mistakes happen and don't get corrected because nobody noticed (i.e. because the compiler generated code that didn't expose the bug).

      I see. I was confused by the way you phrased the statement, which made it sound like there were many cases of relying on compiler quirks without meaning to, which is just sloppy. Bugs are of course a fact of life, but they should be few and far in between for a mature product like Linux.

    17. Re:gcc 3.3 fails on glibc 2.3.2 by jmv · · Score: 1

      There may be a (non-standard) way to get that behaviour back. However, gcc is still compliant with the standard and I'm guessing there's probably a good reason for the change.

    18. Re:gcc 3.3 fails on glibc 2.3.2 by dhazeghi · · Score: 1

      Wrong. More than half of the active developers of gcc are at other companies. IBM, Apple, Codesourcery, and others. Heck, a good number are volunteers too. All the more reason to bash them, I suppose...

    19. Re:gcc 3.3 fails on glibc 2.3.2 by stephenb · · Score: 1

      Yeah, I get that, it is bad. But it's not a GCC issue, it's a libstdc++ issue. This article is about a new release of GCC, not libstdc++. The OP is acting as if a new release of GCC should have fixed a bug that is strictly a libstdc++ bug. I was attempting to point this fact out in a succinct manner. Obviously I needed more words.

    20. Re:gcc 3.3 fails on glibc 2.3.2 by JAKJ · · Score: 1

      Don't troll. The poster said *IF* it is due to crappy code. I am personally against all non-hardware bug workarounds, because it just encourages those bugs to stay. Honestly, unless you are in an emergency situation and not using the software isn't an option, why should the compiler even *allow* language violations? Why even bother with a language? Say "this code comes from my intense psychic powers and if your system can't use cosmic rays to figure out what even I didn't intend, it's your fault"!?

    21. Re:gcc 3.3 fails on glibc 2.3.2 by nusuth · · Score: 2, Interesting
      glibc is part of GNU project and gcc compiled stuff is expected to link with it more often than not, so I concur about compatibility. I think glibc people be warned and should be fixed before release of gcc though.

      As for the kernel, which "the" kernel is that?

      --

      Gentlemen, you can't fight in here, this is the War Room!

    22. Re:gcc 3.3 fails on glibc 2.3.2 by The+Smith · · Score: 1
      The Linux kernel uses virtually every feature of gcc there is, that's why it's the traditional stress test. There will always be little inconsistencies and changes in how the compiler behaves, but because the kernel uses a lot of unusual features it's much more likely to be affected than a user-mode program.

      As far as I know, the currently recommended compiler for building the kernel is 2.95.3. Using the 3.x releases is dodgy at best, and there was never really any chance that 3.3 would work straight away.

    23. Re:gcc 3.3 fails on glibc 2.3.2 by rabidcow · · Score: 1

      The same is true with compilers: unless you have a compiler that generated bad code for 100% of the cases where you're not following the language perfectly, you won't catch all bugs.

      Even if it does you're not very well off. Optimally it would refuse to generate any code at all when you aren't following the language perfectly.

    24. Re:gcc 3.3 fails on glibc 2.3.2 by SexyAlexie · · Score: 1

      Put like that, yes, you'd be right. But still it's quite a bad regression from 2.95.3.

      --
      I'm too sexy for you.
    25. Re:gcc 3.3 fails on glibc 2.3.2 by juhaz · · Score: 1

      So it should work with all the gnu projects at all costs even if they're full of broken and noncompliant code? Just because they've got the word GNU in their name? Wow. Quite a requirements you have there.

      How about I'd want it to work with what C-compiler is supposed to work. C code, that is. Good C, standard compliant C, and screw all code that isn't exactly that, GNU or not GNU.

  3. SERVAR == TEH VARY SLWO by Anonymous Coward · · Score: 4, Informative

    Caveats
    The preprocessor no longer accepts multi-line string literals. They were deprecated in 3.0, 3.1, and 3.2.
    The preprocessor no longer supports the -A- switch when appearing alone. -A- followed by an assertion is still supported.
    Support for all the systems obsoleted in GCC 3.1 has been removed from GCC 3.3. See below for a list of systems which are obsoleted in this release.
    Checking for null format arguments has been decoupled from the rest of the format checking mechanism. Programs which use the format attribute may regain this functionality by using the new nonnull function attribute. Note that all functions for which GCC has a built-in format attribute, an appropriate built-in nonnull attribute is also applied.
    The DWARF (version 1) debugging format has been deprecated and will be removed in a future version of GCC. Version 2 of the DWARF debugging format will continue to be supported for the foreseeable future.
    The C and Objective-C compilers no longer accept the "Naming Types" extension (typedef foo = bar); it was already unavailable in C++. Code which uses it will need to be changed to use the "typeof" extension instead: typedef typeof(bar) foo. (We have removed this extension without a period of deprecation because it has caused the compiler to crash since version 3.0 and no one noticed until very recently. Thus we conclude it is not in widespread use.)
    The -traditional C compiler option has been removed. It was deprecated in 3.1 and 3.2. (Traditional preprocessing remains available.) The header, used for writing variadic functions in traditional C, still exists but will produce an error message if used.
    General Optimizer Improvements
    A new scheme for accurately describing processor pipelines, the DFA scheduler, has been added.
    Pavel Nejedly, Charles University Prague, has contributed new file format used by the edge coverage profiler (-fprofile-arcs).

    The new format is robust and diagnoses common mistakes where profiles from different versions (or compilations) of the program are combined resulting in nonsensical profiles and slow code to produced with profile feedback. Additionally this format allows extra data to be gathered. Currently, overall statistics are produced helping optimizers to identify hot spots of a program globally replacing the old intra-procedural scheme and resulting in better code. Note that the gcov tool from older GCC versions will not be able to parse the profiles generated by GCC 3.3 and vice versa.

    Jan Hubicka, SuSE Labs, has contributed a new superblock formation pass enabled using -ftracer. This pass simplifies the control flow of functions allowing other optimizations to do better job.

    He also contributed the function reordering pass (-freorder-functions) to optimize function placement using profile feedback.

    New Languages and Language specific improvements
    C/ObjC/C++
    The preprocessor now accepts directives within macro arguments. It processes them just as if they had not been within macro arguments.
    The separate ISO and traditional preprocessors have been completely removed. The front-end handles either type of preprocessed output if necessary.
    In C99 mode preprocessor arithmetic is done in the precision of the target's intmax_t, as required by that standard.
    The preprocessor can now copy comments inside macros to the output file when the macro is expanded. This feature, enabled using the -CC option, is intended for use by applications which place metadata or directives inside comments, such as lint.
    The method of constructing the list of directories to be searched for header files has been revised. If a directory named by a -I option is a standard system include directory, the option is ignored to ensure that the default search order for system directories and the special treatment of system header files are not defeated.
    A few more ISO C99 features now work correctly.
    A new function attribute, nonnull, has been added which allows pointer arguments to functions to be specified as requiring

    1. Re:SERVAR == TEH VARY SLWO by jmccay · · Score: 1

      >Also, some individual systems have been obsoleted: ...
      >Intel 386 family
      >Windows NT 3.x, i?86-*-win32

      Does this mean that they are not going to support win32 any more. I still use mingw (Windows Port of gcc) as my primary compiler because it's free, and I don't have money to replace my PII 350 Windows 98 system.

      --
      At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
    2. Re:SERVAR == TEH VARY SLWO by dhazeghi · · Score: 1

      Mingw32 is still supported, and probably will be for a long time to come. As is cygwin.

  4. Sigh by unixmaster · · Score: 5, Interesting

    And "cant compile kernel with gcc 3.3" messages started to appear on lkml. Is it me or gcc team goes for quantity rather than quality that they even postponed many bugs ( like c++ compile time regression ) to gcc 3.4 to release 3.3...

    --
    Never learn by your mistakes, if you do you may never dare to try again
    1. Re:Sigh by Ed+Avis · · Score: 4, Informative

      In the past, when a kernel has not compiled with a new gcc version it has been more often a bug in the kernel than one with gcc. The same goes for most apps. Looking at the list archives, the main problem seems to be with __inline__ which was a gcc extension to start with, so the problem is presumably that the meaning of that keyword has been deliverately changed.

      --
      -- Ed Avis ed@membled.com
    2. Re:Sigh by unixmaster · · Score: 1

      Maybe the kernel is buggy but what about increasing c++ compile time regressions since gcc 3.0 ?

      --
      Never learn by your mistakes, if you do you may never dare to try again
    3. Re:Sigh by norwoodites · · Score: 4, Informative

      Linux, the kernel, depends on old gcc extensions that are slowly being removed from gcc, extensions that were not documented. Also c++ compile time is a hard thing to fix if you want a full c++ compiler in a short period of time. 3.3 is very stable compiler, even 3.4 in the cvs is a stable compiler. The gcc team are all volunteers so why do you not help them and fix some problems, and/or report some problems to us (I am slowing helping out now).

    4. Re:Sigh by norwoodites · · Score: 2, Insightful

      Correctness is more important than compile time that is why it is being pushed back, most of the compile time regressions have to do with the inliner and its limits.

    5. Re:Sigh by unixmaster · · Score: 1

      Well testing is helping too just got my gcc-3.2.3-gcc-3.3 patch. I have latest 2.5.x kernel so I can try and report any failures. Btw I did not mean to say gcc 3.3 does suck or anything like that its just they are postponing bugs to get a release done that hardly makes a user happy. I would wait for more if they promised to fix c++ compile time regression.

      --
      Never learn by your mistakes, if you do you may never dare to try again
    6. Re:Sigh by Horny+Smurf · · Score: 5, Informative

      gcc 3.4 is slated to include a hand-written (as oppsed to yacc-built) recursive descent parser (for c++ only). That should give a nice speed bump (and fixes over 100 bugs, too).

    7. Re:Sigh by r00zky · · Score: 1

      I bet that will be fixed in 3.4, with the inclusion of precompiled headers...

      see gcc 3.4 projected changes here

      --
      I'm a chainsmokin' alcoholic sociopath, so-ci-o-path
    8. Re:Sigh by pixelbeat · · Score: 1

      This is a gcc bug IMHO:

    9. Re:Sigh by aes12 · · Score: 1

      From the Linux Kernel HOWTO:

      5.4. What version of gcc and libc do I need?

      Linus recommends a version of gcc in the README file included with the linux source. If you don't have this version, the documentation in the recommended version of gcc should tell you if you need to upgrade your libc. This is not a difficult procedure, but it is important to follow the instructions.


      From the kernel 2.4.20 README file:

      Make sure you have gcc 2.95.3 available. gcc 2.91.66 (egcs-1.1.2) may also work but is not as safe, and *gcc 2.7.2.3 is no longer supported*.
      Also remember to upgrade your binutils package (for as/ld/nm and company) if necessary. For more information, refer to ./Documentation/Changes.


      Now, why on earth would anyone think that it's either of thier faults that the new gcc won't compile the kernel. Linus has told you that it probably won't...

    10. Re:Sigh by Anonymous Coward · · Score: 1, Interesting

      Aren't hand-coded recursive descent parsers generally slower than machine-generated ones? Isn't that the point of YACC?

    11. Re:Sigh by uncleFester · · Score: 3, Interesting

      In the past, when a kernel has not compiled with a new gcc version it has been more often a bug in the kernel than one with gcc..

      not really; it's a combination of kernel developers trying things to deal with 'intelligent' inlining, or implementing hacks when they discover an idiosyncrasy with GCC. As the gcc team 'resolves' (fixes? ;) such things the hacks may then fail, resulting in compile errors. unfortunately, this can make the code MORE fun as you then have to add compiler version tests to check which code should be used.

      The goal, though, is using the latest kernel with the latest compiler will generate the most correct code. Simply pointing a finger at the kernel developers is incorrect; both sides can be the cause of compiler failures.

      disclaimer: not a kernel developer, just a more-than-casual observer.

      'fester

      --
      -'fester
    12. Re:Sigh by Per+Abrahamsen · · Score: 2, Informative

      Yacc and similar tools are optimized for languages with "nice" grammars, and have hacks to support languages with less nice grammars. The number of hacks needed to support C++ is so large that it evidently slow down the whole parser, not to mention make it unreadable. At that point, writting an add-hoc parser is better.

    13. Re:Sigh by t · · Score: 1

      It is a point release. Perhaps you should wait till 4.0? It might be awhile though. The reason they do more point releases is because they don't want to get caught in the trap that killed the original gcc project (do recall that the current gcc tree is the egcs fork that became the official tree).

    14. Re:Sigh by TrekkieGod · · Score: 1
      why do you not help them and fix some problems, and/or report some problems to us (I am slowing helping out now)

      You're slowing helping out? Is that a job in tech support that I was unaware of? How do you do that? Do you ask the people reporting the problem obvious questions? Do you refer them to useless documentation that doesn't relate to your problem? Darn!!! That's why microsoft's tech support doesn't work...I keep reaching the people hired to slow the helping out, rather than help.

      --

      Warning: Opinions known to be heavily biased.

  5. Bounds Checking by the-dude-man · · Score: 4, Interesting

    I hear they have added in some more advanced, and aggressive bounds checking. Now when i screw up something i wont have to wait for a seg-v to tell me that pointer moved a little too far.

    Although it dosnt seem to work with glibc....this is quite annyoing, although it probably will be fixed and re-released in a few days

    1. Re:Bounds Checking by asuffield · · Score: 5, Informative
      I hear they have added in some more advanced, and aggressive bounds checking. Now when i screw up something i wont have to wait for a seg-v to tell me that pointer moved a little too far.

      Indeed, that SIGSEGV becomes a SIGABRT instead. This is dynamic bounds checking; it won't find anything until the bounds error occurs at runtime, so you won't find it any earlier. All it does is make sure that no bounds errors escape *without* crashing the process.

      Although it dosnt seem to work with glibc....this is quite annyoing, although it probably will be fixed and re-released in a few days

      I guess you didn't read the documentation. This is a "feature". It breaks the C ABI, forcing you to recompile all libraries used in the program, including glibc.

    2. Re:Bounds Checking by swillden · · Score: 3, Interesting

      I hear they have added in some more advanced, and aggressive bounds checking.

      What are the run-time performance implications of this bounds checking? It sounds very nice for debugging, and a great thing to turn on even in production code that may be vulnerable to buffer overflow attacks, but it can't be free. A bit of Googling didn't turn up anything; does anyone know how expensive this is?

      --
      Note to ACs: I usually delete AC replies without reading them. If you want to talk to me, log in.
    3. Re:Bounds Checking by Mitchell+Mebane · · Score: 1

      I guess you didn't read the documentation. This is a "feature". It breaks the C ABI, forcing you to recompile all libraries used in the program, including glibc.

      Sorry, I just couldn't resist the urge to indert a plug for Gentoo. :P

      On Gentoo, doing this is a time-consuming, but rather trivial task. Type emerge -e world, go on vacation for a few days, and find everything working again.

      --

      The roots of education are bitter, but the fruit is sweet.
      --Aristotle
    4. Re:Bounds Checking by juhaz · · Score: 1

      On every sane distro this is a very trivial and not that time-consuming task. Type up2date, apt-get update && apt-get upgrade, or something similar, then go for a cup of caffee and come back after few minutes and find that everything is working again.

      Nice, isn't it? No need to wait for two days for your stupid *%FD%#:"%#:n excuse of a distro to compile.

      Guess one can never understand gentoo loonies.

  6. Be careful by swagr · · Score: 3, Funny

    I'm waiting for SCO to show it's copied code before I pick up any GNU software.

    --

    -... --- .-. . -.. ..--..
    1. Re:Be careful by JAKJ · · Score: 1

      If you don't mean what you say, don't say it. If you say what you don't mean and you get slammed for it, take it like you deserve it or go win yourself a Darwin award.

    2. Re:Be careful by swagr · · Score: 1

      Anyone who knows anything knows that there is no information about horses in the word "horse". Yet we use the word anyway when what what we actually mean is our idea of what we think the the second party's idea of a horse is.

      You see, communication is much more than what you seem to think it is. Part of the charm of being human is that we can say things other than what we specifically mean, and a smart person on the other side of the communication will still understand what we mean. In short, we are not idiots.

      It seems like you didn't know this, so let me give you a few pointers:
      Victory, contrary to what you may have heard, does not have a taste (sweet or otherwise).
      And when someone says "I'll call you later", you aren't witnessing an act of a psychic foreseeing the future. What they mean is "At this moment I beleive that in the future I will make an attempt to call you."

      Anyway, I'll let you look into this for yourself.

      --

      -... --- .-. . -.. ..--..
  7. Stricter Checking - Programmers Check Your Stuff by wol · · Score: 1

    I believe this version has stricter checking. It is probably a good idea for everyone with programs out there to do a quick recompile and see if there is something you can improve or error messages you can fix.

    --
    If you think deeply enough, you will have no single direction for your outrage.
  8. ABI? by 42forty-two42 · · Score: 3, Interesting

    Does this release break binary compatibility?

    1. Re:ABI? by Anonymous Coward · · Score: 1, Informative

      No.

  9. Re:this is all well and good by Anonymous Coward · · Score: 2, Informative


    There is one. Its called Visual SlickEdit, it costs $249 dollars.

  10. Re:this is all well and good by REBloomfield · · Score: 1

    erm... KDevelop? Amongst others, there's quite a few good ones now.

  11. slower than the last release.... by oliverthered · · Score: 2, Interesting

    The optimiser has been vastly improved and ....

    The following changes have been made to the IA-32/x86-64 port:
    SSE2 and 3dNOW! intrinsics are now supported.
    Support for thread local storage has been added to the IA-32 and x86-64 ports.
    The x86-64 port has been significantly improved.

    If you wan't compile time performance look at

    Precompiled Headers

    --
    thank God the internet isn't a human right.
    1. Re:slower than the last release.... by gazbo · · Score: 4, Funny

      Sir, as the chairman for The Society of Prevention of Apostrophe Abuse, I must herby report your post's heinous abuse in the "word" wan<deleted>t. Expect a letter from our solicitors very soon.

    2. Re:slower than the last release.... by Anonymous Coward · · Score: 1, Funny
      Expect a letter from our solicitors very soon.

      Soliciting is illegal in the US, except for some counties in Nevada. Usually they spell it out on the arrest warrent, like so: ``soliciting for prostitution''.

    3. Re:slower than the last release.... by JAKJ · · Score: 1

      Soliciting means you're just trying to sell something. Don't you notice "no soliciting" signs near apartment complexes? That means "no vaccuum-cleaner salesmen" as well as "no prostitutes". :P

  12. Sigh, indeed... by squarooticus · · Score: 3, Informative

    You DO realize that most of the problems compiling the Linux kernel with succeeding releases of gcc is due primarily to the kernel team making incorrect assumptions about the kernel output...

    Right?

    --
    [ home ]
  13. Compile-time performance by Hortensia+Patel · · Score: 5, Informative

    Yes, this release (like all 3.x releases) is a lot slower than 2.9x was. This is particularly true for C++, to the point where the compile-time cost of standard features like iostreams or STL is prohibitive on older, slower machines. I've largely gone back to stdio.h and hand-rolled containers for writing non-production code, just to keep the edit-compile-test cycle ticking along at a decent pace.

    The new support for precompiled headers will help to some extent but is by no means a panacea. There are a lot of restrictions and caveats. The good news is that the GCC team are very well aware of the compile-time issue and (according to extensive discussions on the mailing list a few weeks back) will be making it a high priority for the next (3.4) release.

    Incidentally, for those wanting a nice free-beer-and-speech IDE to use with this, the first meaningful release of the Eclipse CDT is at release-candidate stage and is looking good.

    1. Re:Compile-time performance by Ed+Avis · · Score: 1

      I wonder, with the increase in CPU speeds since 2.9x was current, whether a $500 machine now can compile faster or slower than a $500 machine a few years back.

      Of course it would be still nice for gcc not to get slower, or maybe even to get faster :-(.

      --
      -- Ed Avis ed@membled.com
    2. Re:Compile-time performance by MikeTheYak · · Score: 1

      It's a meaningless question if one obeys the standard and the other does not.

    3. Re:Compile-time performance by Ed+Avis · · Score: 1

      But if your C++ code today obeys the standard, and the code you wrote three years ago did not...

      I agree though, standards compliance is more important than compilation speed.

      --
      -- Ed Avis ed@membled.com
    4. Re:Compile-time performance by Hortensia+Patel · · Score: 1

      I looked at Dev-C++ a couple of years ago, at which point it was largely useless for anything but toy projects. (IIRC, it insisted on opening every single file in the project at startup - heh.) Has it improved a lot since then? Maybe time for another look, though I'm pretty sure I'll be moving to Eclipse now.

    5. Re:Compile-time performance by natmsincome.com · · Score: 1

      Here's some tools you might want to look at. I found them right at the end of my last Job using C++ and wish I'd found them at the begining. Together they can really cut compile time down.

      CCache http://ccache.samba.org/ this can make make project build almost 6 tines as fast on following compiles. This isn't very good for doing a ./configure, make, make install but great when you are developing something.

      DistCC http://distcc.samba.org/ use everyones computer to compile the project.

      So if your having slow compile times in a development environment use these to decrease them.

      If at first you don't succeed, don't go sky diving.

    6. Re:Compile-time performance by HuguesT · · Score: 2, Insightful

      That's all very nice to say that 3.x is slower to compile than 2.95.s, but the end result, the executable, is faster (by ~10% on SPEC benchmarks), and 3.x releases are a lot closer to the ISO standards (both C and C++) than 2.95.x, so I don't see why we should all weep.

  14. Re:this is all well and good by double_u_b · · Score: 2, Interesting

    Visual Studio (v6) is a really bad IDE. I prefer Borland C++ Builder from far. And Visual C++ is really abject on some aspects: why does it compiles things differently if you are in debug mode? I used VC++ to code a file compression utility. Operator precedence is not the same between debug and release compiler mode. Debug had the same behaviour than GCC, Watcom or Borland. Release mode had a different behaviour. Not nice, since it took me hours to find wherethe bug was, since you can't easily debug a release executable... Moreover, speed-optimisation nearly always produces bad code. And debugging 'const' functions in C++ make the debugger go wild. Borland had neither of those problems. And the code looked cleaner when showed by BC++ Builder. Nevertheless, what I really like is the EclipseIDE, and the IDE of BeOS.

  15. gcc 3.x compilers have serious C++ perfs issues by ondelette · · Score: 5, Informative

    The new breed of gcc compiler are anywhere from 3 %to 5% slower with file processing using the C++ library. So, compiling the kernel with gcc 3.x is fine, but I suspect that something like KDE which is mostly written in C++ is impacted seriously. At least, all software using the C++ library for IO (fstream) will be much slower. On the other hand, the support for C++ standards is much better so what I do is that I compile using gcc 3.2.3 to validate my C++ and then I run the real thing with a pre 3.x compiler.

    1. Re:gcc 3.x compilers have serious C++ perfs issues by norwoodites · · Score: 3, Informative

      The changes that made C++ compiling slower were for correctness of the compiler so they are needed. I know 3.4 will be faster than 3.3 is(/was), and should be able to speed up even faster.

    2. Re:gcc 3.x compilers have serious C++ perfs issues by dsplat · · Score: 1

      I would not consider 3-5% a serious impact unless it came completely without other benefits. The bug report you linked to talks about a runtime performance impact of 2-5 times slower, not 3-5%. Nobody is going to accept an impact like that except to fix serious bugs in the generated code.

      --
      The net will not be what we demand, but what we make it. Build it well.
    3. Re:gcc 3.x compilers have serious C++ perfs issues by Fzz · · Score: 3, Informative
      We're using g++ with heavy use of templates in a project that currently has ~400,000 lines of code. gcc 3.2.1 takes about 50% longer than gcc 2.95.4. But, gcc 3.2.1 found loads of bugs that gcc 2.95 didn't notice, even with all the error checking enabled. I'd much rather have the extra checking and have to upgrade my compilation machines 6 months earlier, rather than have stupid errors go unreported by the compiler. So far today it looks like gcc 3.3 finds still more bugs in our code than 3.2.1 did.

      Thank you gcc team!!!!

    4. Re:gcc 3.x compilers have serious C++ perfs issues by Magura · · Score: 1

      Now, call me wacky, but a compiler isn't really a good bug checking tool.

      Sure, like most people, I get lazy and run code past a compiler kinda like I'd use a spell checker - but using your compiler to find bugs ... that makes me squirm in my seat.

      Don't get me wrong, I also think going the other way to the point where code should be hand checked as to not produce any warnings/errors on the first compile is a bit silly (Capability Maturity Model kind of thing), and I would also assume the parent poster doesn't use gcc as the only way of finding those kind of bugs, but lint, splint, valgrind and similar is a much better choice than hoping the compiler gets it.

      But then, I refuse to use that pig called C++, so what would I know :)

  16. What does it mean? by commanderfoxtrot · · Score: 2, Interesting

    That's great... but can anyone tell us what a difference all that will make? I don't really care about compile times (too much)... but will mpeg2enc or ffmpeg run faster?

    BTW, there is a preliminary ebuild in Gentoo.

    --
    http://blog.grcm.net/
    1. Re:What does it mean? by noda132 · · Score: 5, Informative

      Not many visible changes. Developers have better profiling, which means eventually if they care they can make software faster. Also, you're going to find a lot more compiler warnings, and perhaps the odd piece of software which doesn't compile at all. In the short run, nothing changes. In the long run, programs become better as they stick to better programming guidelines (since gcc doesn't support "bad" programming as well as the previous version).

      I've been using gcc 3.3 for months from CVS, and have had no problems with it (except for compiling with -Werror).

    2. Re:What does it mean? by commanderfoxtrot · · Score: 2, Interesting

      In the short run, nothing changes. In the long run, programs become better as they stick to better programming guidelines

      Not very promising!! Basically you're saying this won't make much difference to the end user in terms of speed. I'm not arguing -- I'm agreeing.

      Personally, I would much rather have a slow compiler which gets the most out of my system. Apparently the gcc2.95-age compilers are faster than the gcc3 series: in my book that's a good thing. But has anyone done any testing? How long does it take to do something CPU intensive with each compiler version? It wouldn't take much skill to make a script encoding an SVCD using mencoder/transcode compiled with different gcc versions -- any takers? (I'm in my master's exams...)

      And when will there be proper support for my Morgan Duron? At the moment I use athlon-xp in order to use my SSE instructions: but surely the cache size makes a difference to the code gcc should put out?

      --
      http://blog.grcm.net/
    3. Re:What does it mean? by Anonymous Coward · · Score: 2, Interesting

      AFAIK there are no automatic cache optimizations that would be relevant in a relatively low-tech compiler such as GCC. There are some commercial bleeding-edge compilers that can do cache blocking in some circumstances, but languages such as C and C++ make such optimizations fiendishly complicated. Also, I've never seen cache sizes mentioned as an issue with regards to GCC optimizations, and I've been using GCC and following its development for close to a decade now.

    4. Re:What does it mean? by stripes · · Score: 1
      In the short run, nothing changes.

      Isn't the DFA pipeline schedular much better at producing fast code for VLIW and wide issue super scaler CPUs? (and if the P4 isn't "wide issue", it at least deals with knowing which instructions use which pipelines better then the old scheduler).

      I would expect at least some speedups on most superscaler CPUs (i.e. the P1, P2, P3, P4, the AMD K7, the modern and somewhat old PowerPC and SPARCs). Not huge ones since there was a superscaler scheduler before, but the new one is better.

    5. Re:What does it mean? by dhazeghi · · Score: 1

      Yes and no. In theory it's much better. But you have to take advantage of it in the processor descriptions. To date, there hasn't been too much effort on that front. I think only Hitachi SH has had a significant improvement in codegen so far.

    6. Re:What does it mean? by chez69 · · Score: 1

      Actually, it's great. The gentoo wankers who compile everything can test it while the users who get real work done can get a much more stable build later.

      --
      PHP is the solution of choice for relaying mysql errors to web users.
  17. Mostly compatible, but... by r6144 · · Score: 4, Informative

    According to this, if your program is multi-threaded, uses spinlocks in libstdc++, and runs on x86, then you'll have to configure gcc-3.3 for a i486+ target (instead of i386) in order to make it binary compatible with gcc-3.2.x configured for a i386 target. Otherwise when the code is mixed, the bus isn't locked when accessing the spinlock, which IMHO may cause concurrency problems on SMP boxes (?)

    1. Re:Mostly compatible, but... by DarkOx · · Score: 1

      I think the answer to your question in plain english is:
      "Maybe, if those are being run on an SMP box"

      --
      Repeal the 17th Amendment TODAY! Also Please Read http://www.gnu.org/philosophy/right-to-read.html
    2. Re:Mostly compatible, but... by powerlinekid · · Score: 2, Informative

      All configurations of the following processor architectures have been declared obsolete:

      Matsushita MN10200, mn10200-*-*
      Motorola 88000, m88k-*-*
      IBM ROMP, romp-*-*
      Also, some individual systems have been obsoleted:

      Alpha
      Interix, alpha*-*-interix*
      Linux libc1, alpha*-*-linux*libc1*
      Linux ECOFF, alpha*-*-linux*ecoff*
      ARM
      Generic a.out, arm*-*-aout*
      Conix, arm*-*-conix*
      "Old ABI," arm*-*-oabi
      StrongARM/COFF, strongarm-*-coff*
      HPPA (PA-RISC)
      Generic OSF, hppa1.0-*-osf*
      Generic BSD, hppa1.0-*-bsd*
      HP/UX versions 7, 8, and 9, hppa1.[01]-*-hpux[789]*
      HiUX, hppa*-*-hiux*
      Mach Lites, hppa*-*-lites*
      Intel 386 family


      According to the changelog, i386 support (and source) will be removed in 3.4 unless someone tries to revive it.

      --

      can't sleep slashdot will eat me
    3. Re:Mostly compatible, but... by red_dragon · · Score: 2, Informative
      Intel 386 family

      According to the changelog, i386 support (and source) will be removed in 3.4 unless someone tries to revive it.

      Say what?? Don't you mean that only support for Windows NT 3.x has been obsoleted within the x386 family, which is what the changelog actually says?

      --
      In Soviet Russia, Jesus asks: "What Would You Do?"
    4. Re:Mostly compatible, but... by Ioldanach · · Score: 1
      Intel 386 family

      According to the changelog, i386 support (and source) will be removed in 3.4 unless someone tries to revive it.

      Say what?? Don't you mean that only support for Windows NT 3.x has been obsoleted within the x386 family, which is what the changelog actually says?

      Search the changelog for the phrase "Intel 386 family". Looks like its in there to me, if I'm reading it right.

    5. Re:Mostly compatible, but... by Ioldanach · · Score: 1
      Search the changelog for the phrase "Intel 386 family". Looks like its in there to me, if I'm reading it right.

      Oh, ok, serves me right for reading the list as a slashdot entry before checking the original source. Looking at the original source list I see that the phrase "Intel 386 family" is a section heading with NT as its only contents. I imagine the original poster didn't check the original list, either, and made the same error I did.

      That's what results when someone posts the contents of an article instead of a link to it, I guess.

    6. Re:Mostly compatible, but... by volkerdi · · Score: 2, Insightful

      The thing is, if you have to configure gcc-3.3 for and i486 target in order to be binary compatible with gcc-3.2.x comfigured for i386, then gcc support for i386 might as well be dead, because all the OS distributions will be compiling it for i486 (or better). I doubt we'll see too many gcc or glibc packages for i386 after that.

    7. Re:Mostly compatible, but... by Micah · · Score: 2, Interesting

      Is there any reason NOT to declare i386 support dead? No one is going to compile newer software for a 386 (bloat, etc) and older compilers work fine for older software.

    8. Re:Mostly compatible, but... by m0rten · · Score: 1
      Otherwise when the code is mixed, the bus isn't locked when accessing the spinlock, which IMHO may cause concurrency problems on SMP boxes (?)

      I might be way wrong here, but I thought the SMP machines had cache-coherence so that this sort of problem shouldn't occur?

    9. Re:Mostly compatible, but... by Cleveland+Steamer · · Score: 1
      • I might be way wrong here, but I thought the SMP machines had cache-coherence so that this sort of problem shouldn't occur?
      Consider a 2-processor system with no caches where both CPUs simultaneously execute a read-modify-write instruction (for example, OR) on the same location in memory. Without bus locking (the LOCK prefix in the x86 instruction set) you have no guarantee that both processors execute the RMW operation atomically.

      Let's say CPU0 executes "orl $1, ptr" and CPU1 executes "orl $2, ptr". If the 32-bit value at ptr is initially 0, you would expect the resulting value to be 3.

      1. CPU0 reads ptr and sees 0
      2. CPU1 reads ptr and sees 0
      3. CPU0 ORs the 0 with 1 and gets 1
      4. CPU1 ORs the 0 with 2 and gets 2
      5. CPU0 writes its result (1) to ptr
      6. CPU1 writes its result (2) to ptr
      In the above situation, ptr ends up with an incorrect value because the operations did not complete atomically.
    10. Re:Mostly compatible, but... by HuguesT · · Score: 1

      i386 is alive and well in the embedded market, which has been a strong supporter of gcc for a very long time.

  18. Re:insane by Hortensia+Patel · · Score: 1

    I think you missed the "for writing non-production code" qualifier.

    For a small, non-critical app which only needs minimal functionality, hand-rolling is hardly a time sink. Writing a bare-bones string or list implementation takes about five minutes, and in terms of time, will "pay" for itself after a dozen or so compiles.

  19. Re:this is all well and good by BigBadBri · · Score: 4, Funny
    Flamebait?

    Nah.

    Funny as hell, though - Visual Studio is an absolute joy to use.

    Compared to what?

    Having your head nailed to a table?

    --
    oh brave new world, that has such people in it!
  20. Everyone loves GCC? by Call+Me+Black+Cloud · · Score: 3, Informative

    Not for me, thanks. I prefer the dynamic duo of Borland's C++ Builder/Kylix. Cross platform gui development? How you say...ah yes...w00t!

    For Java, Sun One Studio (crappy name)/Netbeans (inaccurate name) floats my boat. There is a light C++ module for Netbeans but I haven't tried it...no need.

    Give Kylix a try - there is a free version you know:

    Borland® Kylix(TM) 3 Open Edition delivers an integrated ANSI/ISO C++ and Delphi(TM) language solution for building powerful open-source applications for Linux,® licensed under the GNU General Public License

    Download it here.

    1. Re:Everyone loves GCC? by turgid · · Score: 2, Interesting

      Kylix is all well and good if you only need to compile code for the i386 architecture. If you need UltraSPARC, MIPS, PowerPC, M68k etc. you're up the creek. If you want a nice Free IDE you could try anjuta. It needs the GNOME libs though.

    2. Re:Everyone loves GCC? by blahtree · · Score: 1

      Kylix sounds great, but in practise it isn't very useful. Kylix 3 is the first release to support C++, and as you can imagine, it is riddled with bugs. Linux support is NOT a priority for Borland. I moved back to gcc after finding that STL would cause internal compiler errors with Kylix. Blech.

      Additionally, Borland's error messages are ridiculously uninformative compared to those of gcc. A little -Wall goes a long ways to catch things that Borland's compiler just will not catch. Borland's got a ways to go.

      If you're making simple gui apps, cool, but if you are making anything of any complexity, stay far, far away!

  21. Re:this is all well and good by TrancePhreak · · Score: 3, Insightful

    Sounds like you just don't have a lot of experience compiling. The first thing you do when something acts out of spec is to clean and then rebuild. This probably would have solved a lot of your troubles. The GNU make has this bug even worse, since it only checks file size most of the time. Speed optimization has _never_ in my 5 years of using VC++ produced bad code. Please stop with the trolling and get back to learning how to use the compilers properly.
    Borland C++ was okay 6 years ago, but after VC6 came out it's easy to see why it's not so great any more. Two more IDE updates and the old BC is left far behind. I'd take many OpenSource IDE's over BC. Features such as auto-completion and code collapsing have saved me a good deal of time & typing.

    --

    -]Phreak Out[-
  22. Re:this is all well and good by Lumpy · · Score: 1

    There is one. Its called Visual SlickEdit, it costs $249 dollars.

    Oh man dont spend that money....

    anjuta is better and much more useable than visual slickedit as a linux based GCC ide for C and C++ and will create your project's Makefiles and everything else automatically.

    I've used it for 6 months and it's easier than anything microsoft has ever written in their IDE and is certianly better than slickedit when you compare the costs.

    I strongly reccomend that EVERY programmer download and try it right now... it's that good (except I WANT color highlighting to be printable! why is it that no programmer's editor cannot print the highlighting in color?)

    --
    Do not look at laser with remaining good eye.
  23. Via C3 Ezra by Simon+Lyngshede · · Score: 1

    They don't really seem to care about not following the standard for i686. You still have to compile everything for i586 on the Via C3 Ezra chips. The specs. for i686 states that cmov is an optional feature in i686 chips but gcc still doesn't check if the cpu supports it. Of cause with the new C3 it doesn't matter, but I don't have one of those.

    Not a big fault, but it would be nice not having to remember to set the cpu type to i586 everytime you compile stuff.

    1. Re:Via C3 Ezra by pixelbeat · · Score: 1

      Just run this script which handles that:

    2. Re:Via C3 Ezra by Simon+Lyngshede · · Score: 1

      No where does it say that a "real" i686 must have cmov, the compiler should check for cmov before using it. I wasn't talking about removing cmov completly, simply have the option of exclude the use of it when I compile things my self.

      Naturally it should affect other i686 users, that would be dumb.

      And yes very wishly Via added cmov to Nehemiah

    3. Re:Via C3 Ezra by cimetmc · · Score: 2

      The main problem is that there is no i586 and i686. After the i486, Intel started calling their processors by names. Overall, there is a high ambiguity of when a processor is an i586 or i686, especially when it comes to non Intel processors and whether they support some specific instructions. The GCC developers realized that and therefore included -mcpu and -march options for a wide variety of cpu types. For compatibility reasons, the i586 and i686 options just alias to pentium and pentiumpro. If your processor is not 100% intruction compatible with an Intel Pentium or Pentiumpro, then you should better use a more approriate processor type when compiling.
      If you check the available options at http://gcc.gnu.org/onlinedocs/gcc-3.3/gcc/i386-and -x86-64-Options.html , you will see that there is even a c3 option available.

      Marcel

    4. Re:Via C3 Ezra by cimetmc · · Score: 1

      Read the GCC documentation, and you will see that i686 is just an alias for Pentiumpro. If your processor does not support the cmov instruction, then it is not Pentiumpro compatible and i686 is the wrong option for you. The cmov instruction is the single most important additional instruction activated by -march=i686 . If you remove that instruction, you severely cripple GCC for all users of Intel processors of really compatible processors. If you want your code to be scheduled for i686, but not use the additional instructions, you can still do that using -mcpu=i686 and -march=i585 . So GCC already has all the options you need to properly compile your programs for any possibly minimum/optimal processor combination you want. Don't ask developers to cripple GCC just because you are using an incompatible processor.

      Marcel

  24. Re:this is all well and good by double_u_b · · Score: 1

    I know about the clean and rebuild all. I tried. But it didn't work. In fact, all the problems began when I asked people to use the const keyword to prevent some side effects at compile time. Borland C++ Builder, at the time I used it, had the code completion thing. I don't know what code collapsing is. I suspect you are talking about Borland C++, not Borland C++ Builder. I used Borland C++ 4.5 and 5, those were buggy IDEs. Worst was Watcom C++ IDE. The text editor could hang the computer 4 times a day. But you use the compiler and IDE your company owns. But VC++6 never had my preference in one aspect: it produces faster code than borland compiler.

  25. nonnull function attribute by dimitri_k · · Score: 4, Informative
    If anyone else was curious to see an example of the new nonnull function attribute, the following is reformatted from the end of the relevant patch, posted to gcc-patches by Marc Espie:

    nonnull (arg-index,...)
    nonull attribute
    The nonnull attribute specifies that some function parameters should
    be non null pointers. For instance, the declaration:

    extern void *
    my_memcpy (void *dest, const void *src, size_t len)
    __attribute__ ((nonnull (1, 2)));

    causes the compiler to check that, in calls to my_memcpy, arguments dest
    and src are non null.

    Using nonnull without parameters is a shorthand that means that all
    non pointer [sic] arguments should be non null, to be used with a full
    function prototype only. For instance, the example could be
    abbreviated to:

    extern void *
    my_memcpy (void *dest, const void *src, size_t len)
    __attribute__ ((nonnull));

    Seems useful, though I suspect many derefernced pointers are set NULL at runtime, and so not spottable during build.

    Note: I didn't change the wording above at the [sic], but I believe that this should read "all pointer arguments" instead.
    --
    sig is
    1. Re:nonnull function attribute by Abcd1234 · · Score: 1

      Well, spotting null pointers is only so useful anyway. My own intuition suggests that most pointer problems are related to pointers with undefined values in them. Either they weren't initialized in the first place, or they were free'd prematurely.

      Besides, checking for NULL can be quite easily done at runtime using assert(). 'course, having the compiler do it at compile time will catch a few cases, and doesn't incur the (minor) performance hit of doing a runtime check, but it still strikes me as a narrowly useful feature.

    2. Re:nonnull function attribute by GlassHeart · · Score: 3, Interesting
      Seems useful, though I suspect many derefernced pointers are set NULL at runtime, and so not spottable during build.

      It's possible to check at compile time. It's not so much that the compiler detects whether a parameter is null or not at compile time, but whether it can be. For example:

      extern void do_work(void *) __attribute__ ((nonnull));
      void *p = malloc(100);
      do_work(p);
      can trigger a warning or error, because malloc() does not return a "nonnull" pointer, and so passing p to do_work is dangerous. On the other hand, given the code:
      extern void do_work(void *) __attribute__ ((nonnull));
      void *p = malloc(100);
      if (p != NULL) {
      do_work(p);
      }
      then the compiler can work out that the call is safe. This is how LCLint, for example, can do with its /*@null@*/ attribute. The logic will be a little like tracing whether a const variable is passed to a function expecting a non-const parameter. I don't know how far gcc plans to take this feature.
    3. Re:nonnull function attribute by mad.frog · · Score: 1

      Um, and this is better than using a C++ reference... how?

    4. Re:nonnull function attribute by IcePic · · Score: 1

      try this:
      -----------
      int a;
      a=atoi(getenv("DONT_EXIST"));
      -----------
      to see a short piece
      which would gain from this.
      This will only fail when the variable DONT_EXIST
      doesn't exist, which it obviously will in your
      own comfy environment, but not in your customers,
      from where the bomb will be clearly visible. =)

      --
      -- I'm as unique as everyone else.
    5. Re:nonnull function attribute by spitzak · · Score: 1

      It does sound equivalent, so I think the main advantage is that it can be used in languages that don't have references.

    6. Re:nonnull function attribute by TheRaven64 · · Score: 1

      C has had references since '99, pascal has had references since, umm, whenever, in Java everything is a reference. I've never used Fortran, so maybe that's what you are talking about?

      --
      I am TheRaven on Soylent News
    7. Re:nonnull function attribute by Abcd1234 · · Score: 1

      Yes, but in your example, this code is non-portable. One can't guarantee, on all compilers, or even with different libc's, that atoi() is making use of the nonnull attribute. IMHO, this feature is only really useful for user-written functions, and again, I would argue assert() accomplishes the same thing (and in a portable fashion).

  26. Re:this is all well and good by TrancePhreak · · Score: 1

    Well that's rather odd then. I've had const all over the place in a couple projects and everything seemed to work just fine. I wouldn't throw out the possibility of the compiler misbehaving at this point, but I'd still guess it to be something else. Code collapsing is like being able to fold a piece of paper so that you only see the parts you want to. A lot of newer IDE's have this.

    --

    -]Phreak Out[-
  27. Re:this is all well and good by double_u_b · · Score: 1

    I must say that when I first saw the code, it was really messy... So the cleanup was long and difficult. I remember the problem occured in a private static const function that dealt with the serial port. Code collapsing sounds a cool feature, but the VC++ we used (VC6) didn't have this. Now, I don't code in C/C++ anymore, or just for fun. I use the worst IDE I know of (even if it feature some kind of "code collapsing"): Cool:GEN to produce COBOL

  28. Intel C++ Compiler 7.1 Rules by Anonymous Coward · · Score: 4, Interesting

    Intel's compiler smokes gcc in most benchmarks (not surprising, given that Intel knows how to squeeze every last bit of performance out of their own processors). Although it is not 100% compatible with all the gcc features, and therefore can't compile the Linux kernel, each release adds more and more compatibility. I hope the day will soon come when we can compile a whole Linux distribution with the Intel compiler.

    1. Re:Intel C++ Compiler 7.1 Rules by Anonymous Coward · · Score: 2, Informative

      I believe that the 7.x versions can now compile the kernel, and Intel have benchmarks to show it.

      Of course as always, Gcc is still your number 1 choice for anything other than x86 compilation.

    2. Re:Intel C++ Compiler 7.1 Rules by BreadMan · · Score: 2, Insightful

      no software is good enough to pay for

      You don't pay for software as much as you pay people for making software. I don't work for free and I'm betting you don't either.

      The gcc compiler/toolset is great. You can tell the engineers put thier heart in the work, to paraphrase a robber baron. Putting few bucks into thier pockets to reward them for thier hard work and excellent product is A Good Thing. Recognition is great compensation if your other material needs/wants are met.

      Check out the FSF shopping page. The books are great and well worth the money. The art work isn't quite my thing. Does your employer match United Way contributions? Direct some of your giving to the FSF.

    3. Re:Intel C++ Compiler 7.1 Rules by be-fan · · Score: 2, Informative

      Actually, GCC is really close to Intel C++. If you check out the benchmarks it's neck-and-neck on most code except for some Pentium 4 code and some numeric code. These differences are mainly due to Intel C++'s better inliner and automatic vectorizer. I do agree, though, that Intel C++ rocks. It's free for personal use on Linux, very GCC compatible, and almost as conformant as GCC to the C++ standard. It's also got extremely good error messages, which very important for C++ programmers.

      --
      A deep unwavering belief is a sure sign you're missing something...
    4. Re:Intel C++ Compiler 7.1 Rules by RealAlaskan · · Score: 2, Insightful
      Intel's compiler smokes gcc in most benchmarks ...

      How's its performance on SPARC III? Does it optimize well for the Athlons? How about the PowerPC CPUs? And the MIPS CPUs? Does it cross-compile for the IBM mainframes? Does it run on them?

      Although it is not 100% compatible with all the gcc features, and therefore can't compile the Linux kernel, ...

      Oh.

      How about the object code? Can its object code be linked to code compiled by gcc, or is using this an all-or-nothing proposition?

      I hope the day will soon come when we can compile a whole Linux distribution with the Intel compiler.

      That would be nifty, indeed. At least it would be nifty for the distributions which run ONLY on Intel CPUs. Which distribution would that be?

      Intel's compiler is certainly peachy, and I would certainly endorse its use by folks who have Intel systems and need to get maximum performance out of them. Same story for the Digital/HPAQ compiler and the folks with the Alpha systems.

      For the rest of us, the folks without Intel CPUs, Intel's peachy compiler is not so much of a muchness. But don't let that stop you from going crazy with it.

    5. Re:Intel C++ Compiler 7.1 Rules by Garen · · Score: 1

      Those benchmarks you linked to aren't worth much. One thing to note thats not emphasized there is that the author was only able to get close by being told by a GCC insider about which of the zillions of knobs to turn just right for those benchmarks. Meanwhile, ICC optimizes extremely well by default and the "knobs" you need to know about can all be summarized nicely in a few-page listing by typing "icc -help." Contrast that to the practically encycopedic GCC manual that requires you to go through various backflips to tune apps. (And even then, GCC frequently misses optimization opportunities that it has support for, IME.)

      The claim that ICC has poor error messages is just plain wrong. The EDG C++ front-end that ICC uses is the best there is. Period. This is widely known and even admitted by GCCers.

      The error messages and warnings that ICC produces are in a league of their own compared to GCC. One thing inparticular that I find especially useful is it's ability to generate optimization reports and remarks about prohibitive dependencies in my software that prevents optimizations.

      Another thing ICC has going for it is that it's way the hell more reliable (IME of course.) There's a damn good reason why -O2 is enabled by default when you run icc: it's a lot less likely to screw up your code, and it compiles fast even when optimizing -- faster with -O2 than gcc is at -O0!

      To top it off, I can get it to do two-pass interprocedural optimizations with a simple "-ipo" flag. Thats a lot better way than concatenatting your source into one big giant blob like what KDE does atm.

    6. Re:Intel C++ Compiler 7.1 Rules by Garen · · Score: 1

      How about the object code? Can its object code be linked to code compiled by gcc, or is using this an all-or-nothing proposition?

      Yup. But not necessarily in the reverse. ICC doesn't support all of GCC's extensions, but enough of them to build the Linux kernel.

      For the rest of us, the folks without intel CPUs

      Considering that AMD uses intel's compiler to submit their own SPEC scores, I think you can include those too. Non-x86 stuff like MIPS/PPC/SPARC is out though, but I'm sure you knew that.

    7. Re:Intel C++ Compiler 7.1 Rules by be-fan · · Score: 1

      Setting the right flags for GCC isn't exactly voodoo magic. A quick trip to the Gentoo forums is all it takes. And you only have to choose flags once.

      Also, I think you misread my post. I was prasing ICC's error messages, not GCC's.

      I would disagree that ICC is more reliable. It's aggressive inliner has broken more code for me than GCC's.

      I do agree that the "-ipo" flag is rather nice. Although, I doubt KDE cats all their source into one blob first. GCC doesn't do *any* IPO, not even inside a translation unit. Thus, cat'ing the source code into one file wouldn't make a difference.

      --
      A deep unwavering belief is a sure sign you're missing something...
    8. Re:Intel C++ Compiler 7.1 Rules by gidds · · Score: 1
      It's also got extremely good error messages, which [is] very important for C++ programmers.

      Let's just look at that line again for a bit, shall we?

      I wonder whether that says more about the cruftiness of the language, or the incompetence of most of its programmers...

      [fx: enters nuclear bunker]

      --

      Ceterum censeo subscriptionem esse delendam.

    9. Re:Intel C++ Compiler 7.1 Rules by be-fan · · Score: 1

      Yes, template syntax is rather crufty, and requires good error messages, and sometimes even external tools (STL-Filt) to use easily. However, C++ templates do stuff that Java and C# can only dream about, so many people are willing to put up with a little extra hastle to use them.

      --
      A deep unwavering belief is a sure sign you're missing something...
    10. Re:Intel C++ Compiler 7.1 Rules by gidds · · Score: 1

      Can only dream about? I can't speak for C# (not that I'd want to anyway), but Java's singly-rooted object tree means that it can already do all that stuff. Templates/generics would only add a little compile-time safety. And they're coming in JDK1.5, anyway.

      --

      Ceterum censeo subscriptionem esse delendam.

    11. Re:Intel C++ Compiler 7.1 Rules by Anonymous Coward · · Score: 1

      Except that methods aren't objects, so you have to write off most of and unless you're going to write wrappers around almost everything (probably losing optimization opportunities).

    12. Re:Intel C++ Compiler 7.1 Rules by be-fan · · Score: 1

      Genericity is just the tip of the iceburg (and JDK 1.5's genericity is kinda hackish anyway). The template mechanism can be used as a complete code generator, and is the basis for lots of cool libraries like those found in the Boost, Spirit, Loki, and Phoenix libraries. In particular, the Phoenix library implements a rather decent lambda abstraction, completely through the use of templates. However, all these techniques are rather modern, so it will be awhile before compilers stop spewing 100-line template error messages at you. But the foundations of better error messages (the EDG front-end, Boost Concept Check, STLFilt) are there, so the situation seems to be getting better.

      --
      A deep unwavering belief is a sure sign you're missing something...
    13. Re:Intel C++ Compiler 7.1 Rules by Garen · · Score: 1

      Setting the right flags for GCC isn't exactly voodoo magic. ...

      You will need to often change flags to suit the application. Messing with the inlining knob is especially common for C++ code. At first it might make sense to set that particular one super-high... but when I did that, I ran into cases where GCC's memory usage would explode so much that the Linux OOM killer would kill the process! On windows it goes into swap-hell. Some more ram can fix that, but nobody should be expected to do that (and I don't think 512mb is "too low" for such a task.)

      Also, I think you misread my post. I was prasing ICC's error messages, not GCC's.

      Whoops, maybe so.

      A quick trip to the Gentoo forums is all it takes. And you only have to choose flags once.

      The Gentoo forums is one of the last places I'd ever go to learn that stuff. As someone who's already seen a zillion of those CFLAGS threads, it's obvious to me that many of them never read the manual either and throw in stuff willy nilly left and right (including redundant flags and unnecessary FP flags, ..., the whole shebang.)

      I would disagree that ICC is more reliable. It's aggressive inliner has broken more code for me than GCC's.

      Show me some examples. Having used them both for quite some time now, I'm inclined to think you're being dishonest.

      Although, I doubt KDE cats all their source into one blob first.

      Thats basically what --enable-final does. And/or Makefiles set it up so a single file #include's a ton of others. That shouldn't be necessary.

    14. Re:Intel C++ Compiler 7.1 Rules by RealAlaskan · · Score: 1
      >>How about the object code? Can its object code be linked to code compiled by gcc, or is using this an all-or-nothing proposition?

      >Yup. But not necessarily in the reverse. ICC doesn't support all of GCC's extensions, but enough of them to build the Linux kernel.

      Better than I expected. That's good.

      In my original post I just wanted to point out that however wonderful Intel's compiler might be, it's completely useless for a surprisingly large subset of the machines which run Linux and the three *BSDs. Its also useless for AIX and Solaris and HPUX and TRU64 machines.

      Of course, anyone who can benefit by using the Intel compiler shouldn't let its x86-specific nature stop him. Far better to allow youself to be stopped by the sort of ethical considerations which led RMS to write GCC in the first place, if you're going to let anything stop you.

    15. Re:Intel C++ Compiler 7.1 Rules by cant_get_a_good_nick · · Score: 1

      How about the object code? Can its object code be linked to code compiled by gcc, or is using this an all-or-nothing proposition?

      Code is C object compatible, not (yet) C++ object compatible (both are tracking the STD C++ ABI, not close enough for production use).

  29. Re:this is all well and good by pommiekiwifruit · · Score: 3, Interesting
    Operator precedence is not the same between debug and release compiler mode.

    Are you sure you are not getting precedance confused with order of evaluation between sequence points?

    C++ has fairly flexible rules in that regard, the much discussed (on comp.lang.c++) undefined behavior and implementation-dependant behaviour. For example i=i++; invokes undefined behaviour that may vary between compiler settings. My instinct would be that that is more likely to be the problem than compiler error in most cases. You should post the problem code to see if that is the case.

  30. getc_unlocked by r6144 · · Score: 1
    On a linux system, if you want high performance, use getc_unlocked() instead of getc() (which does implicit locking on the stream), and do the locking explicitly if your program is multi-threaded. This is a glibc extension, so you must check its availablity before using it.

    As for the mmap option... IMHO it is a little bit complicated, and glibc seems to use mmap on read-only streams anyway.

  31. Re:Yes but... by Anonymous Coward · · Score: 1, Interesting

    Agreed. But I see two paths to optimization (probably more--I'm not a compiler writer). First, there are optimizations that work well on all processors. Things like inline function calls, loop unrolling, etc. Second, there are optimizations that work on a per processor basis. For example, using instructions in such a way that the processor's pipelines are filled and that its branch prediction doesn't choke, etc. Clearly Intel has the advantage in making the second type of optimizations. But do you think they also have the advantage in the first type as well? The only way to find out would be for Intel to work on gcc's intel-compling mode. Then benchmarks would show which does the better job of doing optimizations of the first type.

  32. I think the argument can be made by smittyoneeach · · Score: 3, Interesting
    in response to
    Windows - developer friendly. Linux - developer hostile.

    that open source requires more skill on the part of the developer to get through the learning curve.
    A greater amount of knowledge about what is happening at all levels is mandatory to make that GNU\Linux system happen.
    Whether this is a but or feature probably depends on your current location on the learning curve. The more I interact with open source, the more I like the fact that there are relatively fewer secrets about what is occuring, a feature that seems lost by the time you reach the West Coast...
    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
    1. Re:I think the argument can be made by Junks+Jerzey · · Score: 2, Insightful

      open source requires more skill on the part of the developer to get through the learning curve. A greater amount of knowledge about what is happening at all levels is mandatory to make that GNU\Linux system happen.

      No offense, but that's just so much self-justification. Personally, I'm growing tired of that kind of faux elitist stance.

    2. Re:I think the argument can be made by Zebbers · · Score: 1

      then rebuff that statement

    3. Re:I think the argument can be made by smittyoneeach · · Score: 1

      Wasn't the intent.
      It's a segmented market. The genius of Gates is that he targeted the low end, a counter-intuitive thing for the geek in the crowd.
      The last thing I'd do is call myself 31337.
      At some point, there will be a neurological basis for saying some people abastract well, and get off on visualizing the chain of events occuring during a complex process, whereas others couldn't give a flying French fornication about all that detail, and prefer copious eye candy.
      My remark is descriptive, not condescending.

      --
      Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear
  33. Re:this is all well and good by ArmorFiend · · Score: 1

    If you get hopelessly confused, you could try a mailing list. If you write a good question, its highly likely the original developers will respond.

  34. A bug in a deprecated GCC extension by Per+Abrahamsen · · Score: 2, Interesting

    Treating casts as lvalues is a GCC extension, and an extension that has been deprecated for C++ since 3.0 because it causes problems for valid C++ code.

    I believe the plan is to add a warning in 3.4 and remove it in 3.5.

  35. Re:this is all well and good by double_u_b · · Score: 1

    Yes, sorry, I confused. This problem was about the order of evaluation. But I cannot understand why VC++6 has different oreder of evalutation, when in Debug mode and in Release mode. I won't be able to post the code because: - I wrote it two years ago - since it was problem prone, I changed it the days that followed - I don't work in the same company now When I arrived at SAGEM, progammers wereeven releasing Debug versions of their programs, because they didn't want to spend time on finding why release mode was not working (in fact, it was essentialy because in debug mode VC++ was initialising data, I spent a lot of time debugging that in my first month)

  36. inline by Per+Abrahamsen · · Score: 4, Informative

    The inline flag in C and C++ is a hint to the compiler that inlining this function is a good idea, just like register is a hint to the compiler.

    GCC has always treated inline as such a hint, but the heuristics of how to use the hint has changed, so some functions that used to be inlined no longer is inlined.

    The kernel has some function that *must* be inlined, not for speed but for correctness. GCC provide a difference way to specify this, a "inline this function or die" flag. Development kernels use this flag.

    1. Re:inline by Shimmer · · Score: 2, Insightful

      I don't understand this. Inlining is an optimization -- it has no semantic effect. How could failure to inline cause something to break?

      -- Brian

      --
      The most rabid believers in American Exceptionalism are the exact same people whose policies are destroying it.
    2. Re:inline by molo · · Score: 1

      Think shared libraries and header files .. and C++.

      -molo

      --
      Using your sig line to advertise for friends is lame.
    3. Re:inline by jovlinger · · Score: 1

      nope. I'm still confused. How could not inlining a function have a semantic effect? I mean, inlining _copies_ the function, so it should be completely transparent.

      Obviously I'm wrong. How?

    4. Re:inline by WNight · · Score: 4, Informative

      That relies on the assumption that you can always page in the memory containing the subroutine. If you're writing paging code this might not be possible.

      It was a lot harder in real-mode programming, where you couldn't jump to distant code because you had to change segment registers and you had to make sure you backed them up first. Hard to guarantee with C, easy with ASM.

      Besides, there are many optimizations that a compiler has to guess about. It's very hard for it to know if you're relying on the side effects of an operation. If you're looping and not doing anything, are you touching volatile memory each time (where the reads could be controlling memory-mapped hardware) or doing something else similar. That's the most obvious example. There are a ton of pages about compiler optimization. It's really quite fascinating.

    5. Re:inline by p3d0 · · Score: 1
      There are a number of ways. Here's a scenario: suppose I write this function:
      int doSomething(int theFastWay){
      if(theFastWay) fastWay();
      else safeSlowWay();
      }
      Now suppose I call it everywhere like doSomething(1). If it's inlined, the else branch is optimized away completely. There's no call to safeSlowWay. Then, suppose I don't bother to link with the library containing safeSlowWay. We're still fine (though this is arguably a bug) because the link would succeed.

      If this function doesn't get inlined, there will suddenly be a reference to safeSlowWay, and you'll get a link error.

      This is just one example off the top of my head.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    6. Re:inline by p3d0 · · Score: 1
      Or what if there were stack constraints (say we're executing on a sigaltstack), and the frame for the call busts the limit?

      There are plenty of reasons inlining versus not inlining could make code stop working.

      --
      Patrick Doyle
      I mod down every jackass who puts his moderation policy in his sig. Oh, wait a sec....
    7. Re:inline by jovlinger · · Score: 1

      ah. Cool. So the problem is that the binary interface is computed over the optimized code, rather than the unoptimized code.

      I agree: this seems like a bug (not necessarily in GCC, perhaps in the language spec). The optimized code should provide (and require) the same interface (and semantics) as the optimized code.

      But then, I'm just playing armchair language designer here. C has a long history of getting by pretty well by doing what is useful, rather than "right".

    8. Re:inline by Fesh · · Score: 1

      "The optimized code should provide (and require) the same interface (and semantics) as the optimized code."

      I should certainly hope so... *grin*

      I know what you were trying to say... Just couldn't resist.

      --
      --Fesh
      Kill -9 'em all, let root@localhost sort 'em out.
    9. Re:inline by Matthew+Austern · · Score: 1
      I don't understand this. Inlining is an optimization -- it has no semantic effect. How could failure to inline cause something to break?

      If you're writing nonportable low-level code (which wouldn't be too extraordinary in a kernel), there are all sorts of ways you could detect the difference: you could use alloca, you could write code that makes assumptions about the way that stack variables are arranged in memory, you could play tricks with setjmp/longjmp, and so on.

    10. Re:inline by be-fan · · Score: 1

      The problem in the kernel is such:

      Say you've got a file: header.h
      Say header.h looks like this: ...
      int someFunction()
      { ...
      } ...

      Now you assume that someFunction gets inlined. If it doesn't get inlined, then each translation unit contains a copy of someFunction() and when you try to link multiple objects together, you get a redefinition error.

      --
      A deep unwavering belief is a sure sign you're missing something...
  37. The hand written parser by Per+Abrahamsen · · Score: 4, Informative

    Does amazing thing for correctness, and is much easier to understand. However, it is not faster in general. It is faster at some tasks and slower at others, same on average.

    It also exposes tons of errors in existing C++ programs, so expect lots of whining when GCC 3.4 is released.

    GCC 3.4 will have precompiled headers (thanks Apple), which will speed compilation up a lot for project that uses them.

    1. Re:The hand written parser by jelle · · Score: 1

      Where do you get all that info? I'm subscribed to the gcc mailing lists, but there is just too much traffic to keep up with it. Is there a secret kerneltraffic-type list out there for gcc?

      --
      --- Hindsight is 20/20, but walking backwards is not the answer.
    2. Re:The hand written parser by ahornby · · Score: 1

      What about the compile server? Is that an alternative to PCH?

      IMO the problem with PCH is that you end up with all your .cpp's dependant on all your headers - thus stuffing up any attempt at doing correct minimal includes and auto dependency tracking from make.

      --
      -- Thorin sits down and starts singing about gold.
    3. Re:The hand written parser by Matthew+Austern · · Score: 1

      Mark's recursive-descent parser isn't faster than the 3.3 yacc-based parser right now, but there also has been zero performance tuning at this point. There's reason to think that it will be faster once there has been tuning.

      That is: there are a number of places where it's known that the recursive descent parser can be made faster if someone just does the work. There doesn't seem to be similar scope for improvement in the old yacc-based parser.

  38. Re:this is all well and good by jmccay · · Score: 1

    Apperently KDevelop is just about as good. When I was looking into it, and they have scripting in it. I loved scripting in Visual studio.

    --
    At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
  39. Re:this is all well and good by jmccay · · Score: 4, Interesting

    Actually, Visual Studio is a great IDE. It's one of the few things Microsoft did well. It's not easy to understand at first, but it you take the time to learn it, you'll appreciate it.
    My favorite feature was the scripting ability. You could write VB Scripts (or start by recording them as a macro) to accomplish tasks. I wrote several VB Scripts that wrote out comments in the code.
    KDevelop is the only thing I have seen that's close to Visual Studio. I have C++ Builder 3.0 Professional at home, but I still like the design and easy of use of Visual Studio. The C++ Builder interface is missing some things--like scripting.

    --
    At the next eco-hypocrisy-meeting, count the private jets used to get to the meeting. Should be interesting to see that
  40. Another one? WHY?!!! by swordgeek · · Score: 1

    OK, I'm not a developer. I don't write code--I compile it when the tools I need as an admin aren't available as trusted binaries.

    Why, for the love of god, is there a new version of the de facto standard C compiler every week or two? Why can't binary compatability be maintained? WHAT sort of changes and development occur in the land of compiling a language that (as far as I know) isn't changing??!!

    This isn't a rant--these are serious questions. I don't understand why so many changes are being done to a compiler, and why it should affect me as a non-developer. What am I missing here?

    --

    "People who do stupid things with hazardous materials often die." -- Jim Davidson on alt.folklore.urban
    1. Re:Another one? WHY?!!! by Gothmolly · · Score: 1, Funny

      Read the parent post as:

      I don't understand anything about C coding or systems programming, can you please let me bury my head back in the sand so that I can just run D:\setup.exe and load my gamez?!

      --
      I want to delete my account but Slashdot doesn't allow it.
    2. Re:Another one? WHY?!!! by Anonymous Coward · · Score: 1, Informative

      uhm ... it doesn't break binary compatibility.

      It's a minor release, primarily bug fixes and improvements. Would you rather wait months for your favorite show-stopper to get fixed in commercial compilers?

      It may show as broken some code which is broken, but was previously allowed. Expect even more of that with 3.4

    3. Re:Another one? WHY?!!! by jacobm · · Score: 1

      Yes. Read it that way, and then realize it's a totally legitimate request.

      --
      -jacob
    4. Re:Another one? WHY?!!! by patter · · Score: 1


      Read the parent post as:

      I don't understand anything about C coding or systems programming, can you please let me bury my head back in the sand so that I can just run D:\setup.exe and load my gamez?!


      That's pretty unfair, and marginally trollish as well. The question comes from a sysadmin type, that does NOT mean they're a luser.

      You don't need to be C guru, or a systems programming mandarin to be forced to compile code, particularly in the open source world.

      The question was simply 'Why are there so many changes that break binary compatibility?' That is a very valid question, and you need to know nothing about systems programming to explain it without being a troll.

      --
      -- If at first you do succeed, try to hide your astonishment. -- Harry F. Banks
    5. Re:Another one? WHY?!!! by be-fan · · Score: 1

      You have to remember that GCC's C support is stable. The C ABI hasn't changed since around 2.95.x. It's the C++ ABI that didn't stabilize until somewhere in the 3.2.x series. The C++ standard is very complex. GCC probably supports it about 99% correctly (better than almost any other compiler except maybe Comeau C++), which means there are still lots of corner cases to fix. Also, there are lots of speed improvements to work on, and C++ compile speed needs to get fixed. So all these releases are incremental steps on the way to getting everything worked out.

      --
      A deep unwavering belief is a sure sign you're missing something...
    6. Re:Another one? WHY?!!! by cant_get_a_good_nick · · Score: 1

      Why can't binary compatability be maintained?

      It is maintained. gcc 3.2 (maybe it was in 3.1?) started to track the STDC++ ABI. I checked the release notes, I couldn't see any ABI changes in this release. Not only will all versions of g++ be able to interact, but all C++ from all vendors will be able to interact. Intel C++ 7 also is tracking the standard, they think they're close, but at this point they don't recommend mixing objects from g++. The C++ binary compatibility was growing pains until they got this stuff fixed. It's now fixed (or at least well on it's way) and your life will be much easier for it later. Think about being able to get a C++ library from someone and not having to worry what vendor's compiler compiled it. This is the price you pay now. Besides, if you're happy with 3.2.3, don't upgrade.

    7. Re:Another one? WHY?!!! by norculf · · Score: 1

      If they're still using 2.95.3, then obviously their contribution hasn't been substantial. Indeed, the OpenBSD developers rant about this frequently, and it seems that all GCC really cares about is lunax on x86. That IS the platform that pays the salaries of the professional developers working on it for Redhat and whatnot.

  41. Re:this is all well and good by Dan-DAFC · · Score: 3, Informative

    ...I can tell you with certainty that Visual SourceSafe 6.0 is a steaming pile of dog turd that needs to be exorcised, not bug fixed.

    Amen. I wouldn't have thought it possible to write a product that makes CVS look like a sensible choice for source control if I hadn't seen it with my own eyes.

    We used to use SourceSafe, now we use CVS. CVS is an horrific train-wreck of an application but compared to VSS it's a triumph of software engineering.

    --
    Suck figs.
  42. Re:this is all well and good by jonadab · · Score: 1

    Dude, that's what Emacs is for.

    Still, I'm looking forward to the day when normal people don't need
    C/C++ compilers anymore because everything's written in VHLLs. (The
    kernel hackers and compiler/interpreter jocks will of course always
    need the lower-level tools, but application developers someday won't,
    just as today most of them don't need assembly stuff anymore.)

    --
    Cut that out, or I will ship you to Norilsk in a box.
  43. From the changes by pheared · · Score: 2, Insightful


    The C and Objective-C compilers no longer accept the "Naming Types" extension (typedef foo = bar); it was already unavailable in C++. Code which uses it will need to be changed to use the "typeof" extension instead: typedef typeof(bar) foo. (We have removed this extension without a period of deprecation because it has caused the compiler to crash since version 3.0 and no one noticed until very recently. Thus we conclude it is not in widespread use.)


    Or rather, gcc version >= 3.0 is not in widespread use.

    1. Re:From the changes by ichimunki · · Score: 1

      RH9 has it. Gentoo's had it for quite some time. SUSE has it. Debian will, of course, have it officially in about three years, but they have it unofficially now (in fact, they have a prerelease of 3.3 in testing). I suspect it is the feature, not the compiler which is rarely used.

      --
      I do not have a signature
    2. Re:From the changes by dvdeug · · Score: 1

      Or rather, gcc version >= 3.0 is not in widespread use.

      All modern Linux distributions use gcc >= 3.0. Debian uses gcc >= 3.0, and did so even in the last stable release for some platforms. Apple also uses a gcc >= 3.0. Just those groups would constitute "widespread use" by themselves, IMO.

  44. Re:this is all well and good by dead_penguin · · Score: 1

    except I WANT color highlighting to be printable! why is it that no programmer's editor cannot print the highlighting in color?

    Could that be because most programmers don't really do that much printing of code? I haven't printed out any source since my form-feed dot matrix printer died years and years ago.

    That said, pipe your code through GNU enscript to print it, and it should generate some decent syntax hilights. Also, if you're interested in publishing code with hilighting to a web page, Vim can output to html using the currently selected hilight mode.

    --

    It's only software!
  45. That's missing the point by ondelette · · Score: 1

    A lot of code will use fstream read and write.
    That's the standard way to do things. Granted,
    that's not high performance programming... but
    that's common programming. If 90% of C++ code out there is slowed down by at least a fixed percentage, this will have a major impact.

  46. Check out Eclipse by Anonymous Coward · · Score: 1, Insightful

    I agree that Visual Studio is a pretty decent IDE. I've used it for years and have grown to love it.

    However, after using Eclipse, I'm never going back (except if I need a good Win32 GUI resource editor).

  47. Re:this is all well and good by jonadab · · Score: 2, Insightful

    > Windows - developer friendly. Linux - developer hostile.

    Is that why Windows has 95% of the users and 60% of the developers,
    while Linux/BSD/Unix (excluding Mac) have 1% of the users and 85%
    of the developers? Yeah, Linux is *real* developer-hostile. The
    way it hides all the implementation details makes it so hard for
    programmers to get things working...

    Calling Linux user-hostile would be a gross exaggeration, but at
    least it would be barking up something that resembles a tree.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  48. Err, typo... by jonadab · · Score: 1

    I could almost swear I typed 30%, not 85%... sorry for any confusion.
    And yes, all statistics courtesy of Flagrant Estimation Incorporated.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  49. Re:A bug in a deprecated GCC extension by i_am_nitrogen · · Score: 1

    That's a gcc extension? I've been using that in my code for years! Of course, all my code is compiled on gcc... Code like this:

    *(unsigned int *)(voidpointer) = intval;

    isn't valid C/C++? Or do you mean gcc allows something like this:

    (unsigned char)(longval) = charval;

    ?

  50. Re:I don't complain but by borgheron · · Score: 1

    Hey, don't feel bad.

    This happens all the time. I have stopped submitting stories since all it seems to do is give the people who run slashdot fodder to take credit for themselves.

    I believe the practice of favoring one's own select group is called nepotism. :)

    GJC

    --
    Gregory Casamento
    ## Chief Maintainer for GNUstep
  51. Re:this is all well and good by Lumpy · · Score: 1

    Could that be because most programmers don't really do that much printing of code? I haven't printed out any source since my form-feed dot matrix printer died years and years ago.



    so how exactly do you do code reviews? we print it out, copies for each of us and sit in the conference room screaming at each other.

    it's invaluable for a code review.

    --
    Do not look at laser with remaining good eye.
  52. Ridiculous by Anonymous Coward · · Score: 4, Insightful

    Okay, while libc and gcc are technically different projects, as I understand it, I agree that it would seem reasonable to drop a note to the libc folks saying "hey, gcc can't compile libc" and waiting for an update before releasing.

    On the other hand, the argument that the gcc folks should make sure that the *kernel* (presumably the Linux kernel) compiles is absolutely ridiculous. The kernel has been long broken and not language-compliant. I think recent compilers can compile it, but that's very recent, and hardly the fault of the gcc people. The Linux kernel has no association with gcc, and is not an amazingly clean project. Gcc is used in far more places than Linux is -- on just about every OS and architecture in the world. Blocking a gcc release because the Linux kernel doesn't compile would be insane. Gcc is *far* bigger than Linux. It is the standard available-everywhere compiler.

    When someone misuses English, do you correct them or change the entire language to fit their mistake?

    1. Re:Ridiculous by TheRaven64 · · Score: 2, Informative
      Okay, while libc and gcc are technically different projects, as I understand it, I agree that it would seem reasonable to drop a note to the libc folks saying "hey, gcc can't compile libc" and waiting for an update before releasing.

      libc and glibc are not quite the same, however. libc refers to any implementation of the standard c library, while glibc is the GNU version. I use gcc with the MSVCRT, the cygwin libc and the FreeBSD libc. To me glibc is just another piece of software that people who are not me use... When someone misuses English, do you correct them or change the entire language to fit their mistake?

      Actually, often the second. This is how natural languages evolve. On the other hand, doing this with a language like C would be silly (or alternatively you could just rename their abuse of the language C+ or something...)

      --
      I am TheRaven on Soylent News
  53. So when do we get a working debugger for g++? by Anonymous Coward · · Score: 3, Interesting

    It's great to hear about all these new improvements in gcc, but what I really want is a working debugger for C++ code compiled with gcc. The gdb debugger is buggy as all hell. It gives wrong values for variables, has no end of troubles with C++, and often enough when I want to print out the value of a variable it tells me that it can't access that memory, with no further explanation.

    1. Re:So when do we get a working debugger for g++? by Anonymous Coward · · Score: 1, Informative

      The whole gdb situation has had us tearing our hair out for ages. IMHO, it is a serious impediment to being productive with the gcc toolset.

      Etnus (http://www.etnus.com) has a gcc debugger that is not derived from gdb. We're reasonably happy with it so far, although we haven't been banging too hard on it yet. It, BTW, the only commercial debugger for gcc that I've been able to find.

    2. Re:So when do we get a working debugger for g++? by WasterDave · · Score: 1

      Nightmare, isn't it. Last time I was developing actually on Linux (a couple of months back) I had a treasured RH7.3 install with KDE. The stock GCC was a pretty mature 2.x series and hence worked well with the debugger, which in turn worked well with KDevelop.

      Final builds were done by changing the path to the compiler in the makefile over to the GCC du jour. Or even icc.

      Since then I've been on a bit of a portability drive and have been working on an Apple - which is OK, but a notch short of perfect.

      Anyway, I'd find yourself an RH7.3 disk if I were you.

      Dave

      --
      I write a blog now, you should be afraid.
  54. Re:A bug in a deprecated GCC extension by Per+Abrahamsen · · Score: 1

    > *(unsigned int *)(voidpointer) = intval;

    I don't think that code has a problem, the "*" operator uses an rvalue, so you don't actually use the lvalue of the cast.

    If you had written

    (unsigned int *)(voidpointer) =

    I believe you would have been in extension territory.

  55. I don't have a life by Per+Abrahamsen · · Score: 4, Funny

    thus, I can follow the development list.

    1. Re:I don't have a life by TheRaven64 · · Score: 1
      Maybe you could post a regular precis of the list somewhere (your journal, for example) so that those of us who like to think (or at least pretend) that we do have a life could gain the benefit of your time.

      I want to have a life. I don't mean I want to get a life, I mean I want to only have one. Trying to live 3 at a time leads to a shortage of sleep...

      --
      I am TheRaven on Soylent News
  56. Re:this is all well and good by be-fan · · Score: 1

    The reason it's different from debug and release mode is that the optimizer is invoked in release mode. In debug mode, the order of evaluation is probably very straightforward and results in what you expect. In release mode, the optimizer uses the ordering flexibility between sequence points to optimize loads and stores, so the order of evaluation probably becomes different.

    That said, VC++ is a hideously broken C++ compiler. I have nothing good to say about it.

    --
    A deep unwavering belief is a sure sign you're missing something...
  57. OS X binary compatability by Rubel · · Score: 1

    3.2 broke binary compatability with 3.1, right? and 3.1 (modified) is what is used in OS X 10.2. Does this mean Apple will have to do a lot of munging to use 3.3?

    1. Re:OS X binary compatability by dhazeghi · · Score: 1

      Yes. And if you're brave, you can check it out of cvs (Apple's version). Bottom line is that if you're an OS vendor, you can afford to those sort of things.

  58. KDevelop is not just as good. by EnglishTim · · Score: 1

    As far as I can tell, there is nothing as good as Visual Studio for Linux. Naturally, this was a huge disappointment to me when we migrated from NT to Linux at work.

    Don't get me wrong - KDevelop is a brave attempt, and coming along, but it just doesn't match Visual Studio. The most incredibly irritating thing about it is the diabolical project management. I had to hack my copy just to make it slightly useful at all, and eventually I just gave up on it. Now I use jedit, handmade makefiles and kdbg. I still miss MSDEV, though.

    Fairly soon I'll try KDevelop 3 again to see how it's come along, but if you're used to Visual Studio, you will be disappointed.

    I'm still trying to find a nice GUI-driven debugger, as kdbg seems rather flaky.

    1. Re:KDevelop is not just as good. by EnglishTim · · Score: 1

      I've just downloaded it - it seems nice!

      It's a shame though that few editors for Linux have worked out the One True Behaviour For Ctrl-Tab yet, whereby rather than going through all the files in the same order every time, it orders them in order of how recently viewed they were. It makes it much easier to switch between 2-3 source files that way.

    2. Re:KDevelop is not just as good. by zenyu · · Score: 1

      I'm still trying to find a nice GUI-driven debugger, as kdbg seems rather flaky.

      Try the gdb tcl/tk debugger it uses the new binary interface to the debugger so it shouldn't be flacky in the same way any debugger that parses the gdb text output can be. You need recent tcl/tk, but otherwise is not very dependency ridden. I'd like to make a few kdbg points though:

      1/One guy is doing most of the development
      2/He's very receptive to applying patches
      3/The code is actually pretty clean. I was able to patch something that annoyed me in an afternoon. He applied most of it within a week, and the rest after I spent another afternoon cleaning it up a little.
      4/Try the kdb-devel out of cvs with gdb 5.3, I haven't had any problems, and it's a bit more polished than 1.2.7. I do compile the debug versions without threading most of the time, but that isn't much of a restriction for me.

    3. Re:KDevelop is not just as good. by AvantLegion · · Score: 1
      The most incredibly irritating thing about it is the diabolical project management.

      LOL. Good, it's not just me. What a hassle I had just trying to import some outside existing source files to an already-created project!

      I have high hopes for KDevelop - outside of the irritations and hassles (WHY CAN'T I RESIZE THIS DAMN WINDOW FRAME??), and the instability of the Gideon alphas (which, as of the latest alpha release, actually seems to be almost fully fixed), it's quite nice.

  59. KDE is not dominated by binary file processing by Per+Abrahamsen · · Score: 1

    so it shouldn't be affected by this particular regression.

    1. Re:KDE is not dominated by binary file processing by ondelette · · Score: 1

      It also impacts text file processing (see full description of the bug report).

  60. Ugh... project management by EnglishTim · · Score: 1

    As far as I can tell, Anjuta suffers from the same problem as KDevelop - very inflexible automake-based project management. Otherwise I'd be up for using it, but the project management stuff is such a pain in the ass.

  61. Re:this is all well and good by Evil+Grinn · · Score: 1

    Still, I'm looking forward to the day when normal people don't need
    C/C++ compilers anymore because everything's written in VHLLs


    Do Java and C# qualify as "VHLL" to you? If so then you may get your wish. However, you probably meant true scripting languages.

    Almost every user application except for cutting edge games could be written in Perl/tk or Python or XUL or something. Unfortunately, the ability to do this has existed for years if people aren't using it now I don't predict that they'll start.

    (Aside: Back when Java first came out, I remember thinking that it seemed really ass-backwards to try to force the old "compiler" paradigm back into a world (the web) where scripting had already become ubiquitous. Obviously I underestimated the power of the "we're better than you script idiots" elite programmer mindset (And I mean elite, not l33t. The kind of people I'm talking about tend to spell things correctly (and I'm saying all of this as a former scripter who has managed to become "one of them" for the money (HDANCN?)))).

    I am now in serious danger of getting modded off-topic.

  62. make -j by Per+Abrahamsen · · Score: 1

    It is pretty easy to do with a parallel make (GNU make is fine) and a wrapper script that rsh gcc to apropriate machines. I did it back in school when I had access to lots of Unix machines.

    I don't know if there is any projects to formalize this, but in these SourceForge days there most likely is.

    1. Re:make -j by MerlynEmrys67 · · Score: 1
      Lets see, go look at the distcc project samba.org a fast, free distributed C and C++ compiler. It is even more fun when you patch in ccache as well ( I'll let you find that one on the samba site )

      Nothing like having a huge build complete much faster. Turns out that the limit on speed is how fast the machine doing the preprocessing is though.

      --
      I have mod points and I am not afraid to use them
  63. Choices, Intel C/Fortran, GCC... by Bold+Marauder · · Score: 2

    I clicked on one of the intel ads last night and was debating wether or not to download the 'unsupported' linux version of intel C & Fortran. Mostly just to play around with.

    I'm wondering if anyone here has played with intel (esp under Debian) C and has any comments on it versus GCC.

    Also [on a fortran note] if it would be worth getting intel fortran for the sake of fortran 95 support, or should I stick w/ the ubiquitous [sp?] gcc/fortran 77 which runs everywhere?

    Opinions, anyone?

    1. Re:Choices, Intel C/Fortran, GCC... by Aardpig · · Score: 2, Informative

      At the moment, I wouldn't bother switching to the Intel F95 compiler. Although it is a very good compiler (in terms of efficient code generation), it lags behind other compilers in terms of features supported. By this, I mean the TR-15580 and TR-15581 extensions to the FORTRAN 95 language, which most vendors support, and which are linguistically-important extensions which fix mistakes made in the original FORTRAN 90 language spec. Both extensions are endorsed by J3 (the ISO body which publishes FORTRAN standards) and WG5 (the working group which develops new FORTRAN standars -- at the moment, they are working on FORTRAN 2000).

      I am eaglerly awaiting the completion of g95, the GNU gcc-based frontend for FORTRAN 95. At the moment, I use a combination of Intel, Lahey and NAG compilers for my FORTRAN 95 needs, but projects I am programming are specifically geared towards what g95 will support. If you want to program with the future in mind, sure, switch to the Intel F95 compiler; but have in mind that the FORTRAN language itself is advancing, and it might be better to (temporarily) spend some cash and get a compiler which is moving with the the language.

      --
      Tubal-Cain smokes the white owl.
  64. Re:Hmph by magi · · Score: 1

    Right now I'm busy changing all "#include" to "#include"

    Umh, intended to say: changing "#include <iostream.h>" to #include <iostream>". Damn markup.

  65. I'm still amazed by drxenos · · Score: 2, Insightful

    I have always been amazed that such an impressive compiler is still free. Thanks to the GCC team. You guys/gals rock!

    --


    Anonymous Cowards suck.
    1. Re:I'm still amazed by TheRaven64 · · Score: 1
      Well, a true BSD advocate would argue that anything GPL'ed isn't truely free...

      Mind you, then they'd be left without a working compiler...

      --
      I am TheRaven on Soylent News
  66. GCC 3.3 is binary compatible with the 3.2 series by Per+Abrahamsen · · Score: 1

    And why release it?

    It fixes lots of bugs, obviously people who have been bitten by these bugs will want them fixed as soon as possible. And those who need the new feautures tend to need them yesterday.

    All these people are developers. I do not see any reason for non-developers to care, just use the compiler bundled with your OS.

    BTW the last full release was 3.1, quite some time ago. All the intermediate releases (including 3.2) have been bug fix releases with no new features.

  67. Still buggy for Dreamcast by Forkenhoppen · · Score: 2, Interesting

    It's a shame that no one managed to fix bug #10392 before release. Until that one's fixed, those of us who do Dreamcast hacking are stuck using GCC 3.0.4.

  68. If you care about performance... by Per+Abrahamsen · · Score: 1

    install both and measure. My application, a numerical simulation written in C++, was 5% slower when compiled with icc. The better benchmarks show the same thing, icc is faster for some tasks and slower for others, but expect for very specialized tasks they tend to be in the same ballpark for real applications.

    1. Re:If you care about performance... by Per+Abrahamsen · · Score: 1

      None, really. I used -O2/arch/cpu/fast-math flags on gcc, these are default on icc (it got them anyway).

      Both icc and gcc have profile based optimization, I haven't experimented with either.

      One would obviously need two datasets, one for generating the profile, and another for testing performance.

  69. Re:this is all well and good by AT · · Score: 2, Informative

    The GNU make has this bug even worse, since it only checks file size most of the time.

    False. GNU make checks the last file modification time. If you have any problems getting consistant incremental builds, it is probably because the Makefile has incorrect dependency information. For example, if a header file changes the size of a struct, every source file that includes it should be recompiled. An automated tool like "gcc -MM" is the best way to ensure the dependencies are correct.

  70. Re:A bug in a deprecated GCC extension by i_am_nitrogen · · Score: 1

    The patch in the original bug post looks like this:


    - ConfigItem** ip = &(ConfigItem*)menu->data;
    + ConfigItem* i=(ConfigItem*)menu->data;
    + ConfigItem** ip =


    So I guess you're right; the & operator would use an lvalue. One could code *(void*)5, but not &(void*)5.

    The way I would've coded that particular code in one line is:
    ConfigItem** ip = (ConfigItem**)&(menu->data); /* Can't remember if & or -> is evaluated first, so I added () */

    Or the (unsigned int *) example case you gave as:

    voidpointer = (void *)uintpointer;

    So, I really don't see this extension as anything more than a potential way for increasing gratuitous obfuscation for the purpose of the obfuscated C contest.

  71. Waiting for the handmedown from Apple by Soong · · Score: 1

    macosx% gcc --version
    gcc (GCC) 3.1 20020420 (prerelease)

    Not going to go grab the latest GCC because I wouldn't count on it to work with ObjC, MachO, and whatever else Apple may still be patching in.

    --
    Start Running Better Polls
  72. Re:If you use fstreams you ain't into performance by Minna+Kirai · · Score: 1

    It's a POSIX function, so it'll work on most Unixy operating systems. Check /usr/include/sys/mman.h for the prototypes.

  73. Re:If you use fstreams you ain't into performance by Mr+Z · · Score: 1

    It's a POSIX / UNIX way to do things. I'm not sure if the various Windows compilers support mmap. Under Linux and/or UNIX, you can do man mmap to find out more.

    And yes, mmap is very cool. I've used it to great effect in a programming contest where speed was one of the measures. I mmaped the file and faulted it in quickly with a short loop. The overall program flew like a bat outta hell! What's really nice is that you can just refer to the file contents directly by pointer as opposed to reading them or freading them into a buffer. The downside is that it's less portable and harder to get right, which is why I don't use it for everything.

    --Joe
  74. Re:this is all well and good by dead_penguin · · Score: 1

    Fair enough; we do our reviews a little differently.

    We don't do very many "comprehensive" reviews with several people going over a complete feature. Instead, every single line of code that gets checked into source control MUST be reviewed by at least one other person; preferably someone familiar enough with the code to be able to see what it impacts.

    For smaller changes to existing code, a diff of the "before" and "after" code is generally enough to see what was done. Bigger changes usually end up being reviewed by more than one person, just not all at once. All of this is done on the computer.

    It's not perfect, but this works quite well for our situation-- and it saves us some paper as a side-effect.

    --

    It's only software!
  75. Re:this is all well and good by Lumpy · · Score: 1

    ahhhh, makes sense... we have many old-hairs here that require that we kill a forest weekly for every little thing.

    hell they still require that we fill out time sheets online and PRINT THEM to put in their inbox.

    I like your way better.

    --
    Do not look at laser with remaining good eye.
  76. Re:this is all well and good by yamla · · Score: 1

    The Visual C++ compiler included in Visual Studio .NET 2003 is a vast improvement over previous versions. I believe it even compiles the loki library now. :)

    Seriously, what you say is correct for Visual C++ 6 (which was god-awful) and for Visual C++ .NET 2002 (which was only slightly better) but I think you probably haven't tried out the newest one yet.

    --

    Oceania has always been at war with Eastasia.
  77. Re:Hmph by avdi · · Score: 2, Insightful

    Sounds like you've been coding to a very old pre-standard version of C++ for a long time. Don't complain that the standard keeps "refining" - what you are talking about are things that have been stable for years. Count yourself lucky that compilers actually let you get away with it all this time.

    And I hope you aren't putting "using namespace std" in new code. Ugh.

    --

    --
    CPAN rules. - Guido van Rossum
  78. We've fixed that for 3.4, and for 3.3 to some by devphil · · Score: 4, Insightful


    "...to some extent." Why give a Subject: line textbox that won't let me use all of it? Grrr.

    Anyhow. One of the big speed hits for iostream code was the formatting routines. Some other reply has a subject like "if you're using fstream you're not interested in performance anyhow," which is so wrongheaded I won't even bother to read it. There's no reason why iostreams code shouldn't be faster than the equivalent stdio code: the choice of formatting operations is done at compile-time for iostreams, but stdio has to parse the little "%-whatever" formatting specs at runtime.

    However, many iostreams libraries are implemented as small layers on top of stdio for portability and compatability, which means that particular implementation will always be slower.

    We were doing something similar until recently. Not a complete layer on top of stdio, but some of the formatting routines were being used for correctness' sake. We all knew it sucked, but none of the 6 maintainers had time to do anything about it, and the rest of the world (that includes y'all, /.) was content to bitch about it rather than submit patches. Finally, Jerry Quinn started a series of rewrites and replacements of that section of code, aimed at bringing performance back to 2.x levels. One of the newer maintainers, Paolo Carlini, has been working unceasingly at iostream and string performance since.

    So, all of that will be in 3.4. Chunks of it are also in 3.3, but not all. (I don't recall exactly how much.)

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  79. question: will it take quotes in a macro by Rob+Y. · · Score: 1

    >>The preprocessor now accepts directives within macro arguments. It processes them just as if they had not been within macro arguments.
    The separate ISO and traditional preprocessors have been completely removed. The front-end handles either type of preprocessed output if necessary.

    This quote below makes me hopeful.

    I've had trouble with this macro in gcc:
    #define TRIGGER_PUSHBUTTON(c)
    ((PUSHBUTTON16) | 'c')

    gcc doesn't like having the macro add the quotes around the character argument. Only works if you to leave the quotes out of the macro definition and require them in the macro argument.

    But I have a lot of code written on AIX that uses this macro (and others like it). Porting to linux requires 'fixing' all the occurrances.

    Anybody know if this applies?

    --
    Posted from my Android phone. Oh, I can change this? There, that's better...
  80. Re:Hmph by devphil · · Score: 4, Interesting


    Now I understand what Bjarne Stroustrup wrote, when he described /. as "ignorant, and proud of it." Indeed, let the second-guessing begin...

    especially for C++, as it's standard keeps "refining" constantly,

    The standard hasn't changed since 1998.

    as does GCC's interpretation of it. Not to mention the extensions.

    The extensions are, in many cases, older than the standard. Now they conflict with rules added by the standard. One or the other has to give. And, of course, no matter what happens, somebody out there will declare that GCC "obviously" made the wrong choice.

    If you think it's easy, why don't you give it a try? Hundreds of GCC developers await your contributions on the gcc-patches mailing list.

    If you don't like it, you should demand your money back.

    Right now I'm [making changes]. What next?

    Again, the standard was published in 1998. The three changes you describe were decided upon even before then, and they haven't changed since. You've had 5 years to walk down to the corner bookstore and buy a decent book, or search on the web for "changes to C++ since its standardization". None of those changes are due to GCC, and trying to shift the blame to GCC only points out your employer's laziness.

    You've had half a decade. Catch the hell up.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  81. gothmolly sez: by Bold+Marauder · · Score: 1

    d00d! YU0=t3h $u}{0R, I=31337 ]-[@}{0R. 101101101101!!! -g0thm011y

  82. GCC3 preprcessor problem by Mongoose · · Score: 1

    I've noticed in gcc 3.x that #include "header.h" looks for system header matches *before local scoped headers.

    Is it just me or is that wrong and annoying?

    I've had to distribute shell scripts to swap out filenames for compilation ( which wouldn't be fun to do by hand, trust me ) everytime gcc3 compiles the code base.

    I don't track gcc3.x, but has this been fixed or is it intentional to cause confilcts you can't possibly predict on another system?

    Here's a problem you could predict as an example:

    #include "endian.h"

    Then lots of odd compile errors ensue confusing the user. Also #include seemly includes -- wtf is up with that? Are these people using old/bad gcc3.x builds?

    1. Re:GCC3 preprcessor problem by Mongoose · · Score: 1

      I like how slashcode ate my examples all to hell. I got so used to other boards translating the symbols to HTML for me. =(

      #include "endian.h"
      That actually includes <endian.h>

      the last example was:

      #include <dir/math.h>
      Does #include <math.h>

  83. Re:this is all well and good by GlassHeart · · Score: 1
    since it was problem prone, I changed it the days that followed

    Now that you understand the problem, I strongly suggest you acquire an authoritative reference for C or C++, whichever you are using. If you can read the ISO standard, that's obviously the best resource. Electronic copies are available for about $20, I think.

    What you did was rely on something the language never guaranteed. C defines a concept called a sequence point (mainly the ';' at the end of a statement, but there are other sequence points), at which point all previous expressions would have been fully evaluated. Between two sequence points, however, it guarantees nothing. So, this:

    a[i] = i++;
    is undefined, because since '=' is not a sequence point, you don't know which value of 'i' will be used to get a[i]. In fact, as you've found out, it can differ between debug and release builds. On the other hand, this:
    a[i] = i;
    i++;
    is valid C code, because ';' is a sequence point, and 'i' is not both modified and accessed between two sequence points. C++ basically inherits all of this from C. Sequence points in C is a level of understanding that should give you chills thinking back at every line of code you've ever written.

    When I arrived at SAGEM, progammers wereeven releasing Debug versions of their programs, because they didn't want to spend time on finding why release mode was not working

    That's just sloppy. A difference in behavior between debug and release builds can be an indicator of major bugs that are merely better hidden by the debug version. The bug may still surface when the program is subjected to real world loads, or some unexpected input. It's possible that a compiler bug causes the release build to be broken, and so you ship the debug build, but not investigating is plainly irresponsible.

  84. gnu enterprise. free. by zymano · · Score: 1

    http://www.gnuenterprise.org/project/what.html

  85. (OT) Proportional fields in HTML forms by yerricde · · Score: 1

    Why give a Subject: line textbox that won't let me use all of it?

    Because your browser is using a proportional font. Would you want the box to resize, triggering a reflow, every time you type a character? Even with the user-code performance improvements of the GCC 3.x series, the median user would still get lag.

    --
    Will I retire or break 10K?
    1. Re:(OT) Proportional fields in HTML forms by devphil · · Score: 1


      Ah. Good point. My mind still thinks monospace font for some reason. Thanks!

      --
      You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  86. At run time? by yerricde · · Score: 1

    No where does it say that a "real" i686 must have cmov, the compiler should check for cmov before using it.

    The cmov instruction is used in tight loops. Would you really want to branch around cmov at run time based on the cpuid? It'd completely defeat the purpose of cmov. I say define "i686" as an ia-32 CPU with cmov and leave it at that.

    --
    Will I retire or break 10K?
  87. Re:this is all well and good by stephenb · · Score: 1

    There is something, it's called RHIDE. It's actually quite slick, I used to use it for programming apps using djgpp. I haven't used it in quite a while, but it looks like it's still quite active, with the latest release being Feb. of this year.

  88. Re:this is all well and good by shredwheat · · Score: 1

    "Speed optimization has _never_ in my 5 years of using VC++ produced bad code..."

    You make a fairly bold claim that the VC optimizer does not mangle code, especially after proving your limited experience. For a simple example go see the SMPEG mpeg decoder. The core audio decoding functions must be compiled with VC's global optimizations off or it will bork bork bork.

  89. Re:At last by ciaran_o_riordan · · Score: 1

    Vax users everywhere are crying. All eight of them.

  90. Re:this is all well and good by AT · · Score: 1

    Extfs use a one-minute granularity

    Also false. Ext2fs uses has a one second granularity, like most traditional Unix filesystems. This is easily demostratable with "ls -l -time-style=full-iso". While this is still a fairly coarse measurement, I've never seen a problem in practice.

  91. Re:Hmph by The+Bungi · · Score: 1
    Now I understand what Bjarne Stroustrup wrote, when he described /. as "ignorant, and proud of it."

    If you think it's easy, why don't you give it a try? [...] If you don't like it, you should demand your money back.

    Now I understand why a friend of mine calls /. "too arrogant for its own good".

  92. Re:this is all well and good by Horny+Smurf · · Score: 1

    emacs can't print color on my bw laser printer!

  93. my bad: 3-5 times, not 3-5% by ondelette · · Score: 1

    I'm the one who filled the bug report, so I should
    have known better.

    I don't see why anyone would accept the current libc++ for anything else but a beta or even an alpha release.

    It probably doesn't get noticed so much because fstream isn't used that much.

    For something like koffice or kmail, assuming it uses fstream, I suspect that one would notice the difference.

  94. Our experience not so good by spitzak · · Score: 1
    With tiny test C programs the Intel compiler produced stunning results, like sometimes 3 times faster than GCC (this was slightly older gcc, perhaps 2.9.0 or so). Unfortunately as soon as we applied it to our real C++ programs we found the results to run at exactly the same speed. My guess is the stuff was too complicated for it to use any of it's optimizations.

    The Intel compiler on Windows is about 30% faster than VC++ (version 6, we have not tried the .net version yet) with these same C++ programs, and the result is perhaps 4% faster than the GCC 2.9.6 Linux version (the program is entirely compute-bound, so this is not an OS difference). So far we have not seen even this 4% improvement in the Linux Intel compiler, which leads me to believe they have not put as much work into it as they did for the Windows one.

    1. Re:Our experience not so good by HuguesT · · Score: 1

      Hi Bill!,

      Just to confirm I have the exact same experience. After a lot of effort and time spent, the recompile of our complete image analysis library (100% pure C) with the most aggressive optimizations we could find in the Intel documentation yielded a 5% improvement in speed in the final product over gcc-2.96. Not worth the effort.

      However the recompilation effort with icc did point out some ANSI incorrectness and some outright bugs, so it was not completely wasted.

  95. Re:Intel C++ Compiler 7.1 Rules because of OpenMP by ron_ivi · · Score: 1
    Intel's compiler rules on multiple processor systems (including fake-multiprocessor Hyperthreading systems) because of cool compiler-enabled parallel application support via OpenMP.

    http://www.openmp.org/

    With Dual CPU systems and Hyperthreading, you can get near 2X advantages on quite a few algorithms.

    I haven't kept up with Gnu's OpenMP stuff. I guess this is one such project. http://savannah.nongnu.org/projects/gomp/

  96. A question about gcc cpu Optimization? by grolschie · · Score: 1

    With gcc these days is it safe to compile my linux kernel and other stuff optimized for a particular cpu (eg: Athlon K7)? I read somewhere not to do this for the kernel? Grunt, we wants! :-)

    1. Re:A question about gcc cpu Optimization? by dhazeghi · · Score: 2, Interesting

      Well, remember the kernel is to a large extent already optimized. So most generic optimizations won't help a whole lot. Still you can always try. Plus it's a great way to shake out hidden bugs in either gcc or the kernel...

  97. What you need to do... by Jimithing+DMB · · Score: 1

    ... is find something Better Than Ezra.

    Okay, it's a groaner.

  98. Upgrading from 2.96 to 3.3 (or 3.2) gotchas? by Alinraz · · Score: 1

    I do development work using gcc on my local Mandrake machine with 3.2. I tried to compile one of my projects on our server which uses gcc 2.96 and it fails (3.2 follows the ANSI C++ standard, 2.96 is old-style) due to the older C++ libs. I want to upgrade our server to gcc 3.2, but since we've got other projects that work fine under 2.96, we are afraid of breaking the other projects (especially since we are close to release). Does anyone know of any gotchas? Can I just download, compile, and install 3.3 (or 3.2)? Will I also need to download, compile and install a new glibc? Can I install gcc 3.3 and not change my glibc version? Thanks, - Steve

    1. Re:Upgrading from 2.96 to 3.3 (or 3.2) gotchas? by elflord · · Score: 1
      I do development work using gcc on my local Mandrake machine with 3.2.

      Good.

      I tried to compile one of my projects on our server which uses gcc 2.96 and it fails (3.2 follows the ANSI C++ standard, 2.96 is old-style) due to the older C++ libs. I want to upgrade our server to gcc 3.2, but since we've got other projects that work fine under 2.96, we are afraid of breaking the other projects (especially since we are close to release). Does anyone know of any gotchas?

      The older compilers are less strict, so you might need to clean up some compliance issues with your code if you have any. Alternatively, you could just install the new compiler in a different directory (/usr/gcc-3.3) and then place symbolic links to the required runtime libraries in /usr/lib. Then when you compile, place -L/usr/gcc-3.3/lib in the linker line. You don't need to install a new glibc to use a different compiler.

  99. Re:Hmph by HopeOS · · Score: 2, Funny

    I am reminded of a document describing how compilers are like women and assemblers like men. Googled for it, but didn't find it.

    The line I remembered was "things you've been doing for years that seemed OK are now suddenly wrong." I consider myself a pretty astute programmer, but every new compiler version seem to have some new warning to add.

    As a result, I consider my relationship with my compiler no less volatile than that with my wife. Keeps me on my toes anyway.

    -HopeOS

  100. depends a lot on your code by Trepidity · · Score: 1

    I've seen numbers anywhere from 5%-200% penalty, though I don't have any references at the moment. It really depends on the app and where your main execution time lies. If you do a lot of tight loops over arrays, it's going to give you a significant performance hit. If you don't, it won't. So it's probably going to slow down your MP3 encoder a lot, but probably won't result in a noticeable slowdown for most userland apps. For most apps, which are I/O- rather than CPU-bound anyway, it's a good idea for security reasons. Same reason strncpy() is recommended over strcpy(), despite the performance hit due to bounds checking (in fact, strncpy() is just a special-case example of bounds checking).

  101. Re:this is all well and good by be-fan · · Score: 1

    Ack. I should have qualified it. I meant the earlier VS compilers. I have heard that VS.NET 2003 is quite complient.

    --
    A deep unwavering belief is a sure sign you're missing something...
  102. Re:Pentium4 bug by dhazeghi · · Score: 1

    Well, it bootstraps with -march=pentium4, and glibc compiles and runs fine with it, so P4 support certainly has improved. Exactly how good is it? If only I had a P4 to tell...

  103. Re:Intel C++ Compiler 7.1 Rules only on Intel CPUs by cjellibebi · · Score: 1

    I heard a rumour somewhere that if ICC detects an AMD CPU, it either compiles the code to slower code (if it's compiling on an AMD CPU), or it builds EXE's that detect if it's running on an Intel or AMD and if running on an AMD, the EXE runs a bit slower. This was not true for early versions of ICC but at a certain version, they added this detection. Anyone know anything more about this?

  104. Re:this is all well and good by TrancePhreak · · Score: 1

    The answer is however TRUE. As this is the make that comes with a certain development kit and is quite outdated.

    --

    -]Phreak Out[-
  105. Re:this is all well and good by jonadab · · Score: 1

    > Do Java and C# qualify as "VHLL" to you?

    No.

    A VHLL can be compiled, but it has to allow the programmer to take
    certain things for granted, such as memory management. In a true
    VHLL, it is not possible to dereference an invalid pointer, not
    possible to overrun a buffer, not possible to jump to an invalid
    address, ...

    It is still possible to shoot yourself in the foot, of course,
    but you have to do something visibly dangerous, like shell out
    to a system call with untrusted data -- and compiler warnings
    can alert you to all the places you do this, so you can check
    them. You can mess up your checks, of course, or just not
    bother to be careful, but it's better than a traditional HLL.

    > Almost every user application except for cutting edge games
    > could be written in Perl/tk or Python or XUL or something.
    > Unfortunately, the ability to do this has existed for years
    > if people aren't using it now I don't predict that they'll
    > start.

    They are starting; it's just gradual. Also, you (the user)
    don't always _know_ an app is written in a VHLL. I didn't know
    printerdrake was written in Perl until I needed to debug a
    problem I was having. (The problem was not with printerdrake
    as such, just a printer that wasn't supported, and I had the
    manufacturer's PPD and was hoping to figure out how to make it
    work.) I was able to trace the issue as far as foomatic, but
    I ran into a binary (which was probably written in C) and gave
    up then.

    There's a performance penalty for using current versions of
    Perl or Python instead of C. But hardware is getting better,
    making that performance penalty less relevant, and the VHLLs
    are getting better too. Perl6 is going to be *vastly* better
    to work in than Perl5, for example. Personally, I would be
    happy to trade 50% more CPU cycles and 50% more RAM for apps
    developed in VHLLs, for an assortment of reasons, most notably
    because such apps would be much easier to maintain.

    It will come, in time. They said assembly language would never
    pass out of vogue, because you got so much better performance
    with it. Sure, it took longer to write programs, but you got
    programs that performed better... C and its kin are basically
    a case of that same thing.

    What's odd is that lisp doesn't seem to be in this category
    (with C I mean), even though it's quite old as HLLs go. I don't
    think I'd consider common lisp to be a VHLL either, though. I'm
    not sure where to categorise lisp.

    --
    Cut that out, or I will ship you to Norilsk in a box.
  106. Re:this is all well and good by jonadab · · Score: 1

    > If Linux really required all those extra developers for that much
    > less net production

    How do you calculate net production?

    --
    Cut that out, or I will ship you to Norilsk in a box.
  107. Re:this is all well and good by HuguesT · · Score: 1

    > why is it that no programmer's editor cannot
    > print the highlighting in color?

    As everything else, Emacs does it just fine.

  108. Vouching for Anjuta by AvantLegion · · Score: 1
    I don't know why Anjuta doesn't get talked about more. I like KDevelop, but it's awful flakey sometimes (both 2.1.5 and the 3.0 alphas - at least the latest alpha no longer crashes on me). Anjuta is pretty solid, not particularly flashy, but well laid-out and stable.

  109. Re:this is all well and good by rastos1 · · Score: 1
    So, this:
    a[i] = i++;
    is undefined, because since '=' is not a sequence point, you don't know which value of 'i' will be used to get a[i].

    Hm.Let's say i has value 3. = has associativity right to left. So the expression on RHS should be evaluated first: i gets incremented, RHS gets value of 3. Then the LHS is evaluated to a[4]. Finally RHS is assigned to LHS: a[4] get's value of 3.
    However my compilers disagree with each other. Can someone enlighten me?

  110. Re:this is all well and good by GlassHeart · · Score: 1
    Hm.Let's say i has value 3. = has associativity right to left. So the expression on RHS should be evaluated first:

    Please read my post again, or find yourself an authoritative reference in C. In C, the order of evaluation is essentially undefined, except at sequence points, where all previous expressions and side effects are fully evaluated. Accessing and modifying an object separately between two sequence points is undefined behavior.

    It has nothing to do with associativity, which only means anything if your C statement doesn't invoke undefined behavior.

    However my compilers disagree with each other.

    Not only that, your compiler may disagree with itself depending on whether optimizations are enabled or not. This is because you invoked undefined behavior, for which no particular result can be expected.

  111. Re:Hmph by be-fan · · Score: 1

    Actually, the last change was Technical Corrigendum 1 published in 2001. However, it was mostly minor defect fixes, so it's not really an excuse. I think they major reason the original parent is bitching is that he's used to Visual C++ 6.x, which just likes to pretend that the C++ standard hasn't changed since 1995 :)

    --
    A deep unwavering belief is a sure sign you're missing something...
  112. PCH vs. compile server by Per+Abrahamsen · · Score: 2, Informative

    The compile server was still experimental last I heard.

    You need to reorganize your Make files to use pch's efficiently. You should

    1) Not change any of your source or header files.

    2) Add a new "all.h" header including all other headers, and precompile that header and only that header, whenever any other header changes.

    3) all.h should not be included directly from any file, instead compile with a special flag that "pre-includes" all.h.

    4) Because of header guards (which you must use), none of the normal header files will be included.

    5) Because no file include all.h directly, it will not figure in the autmatic generated dependencies, and you should not add it manually. Thus, any source file will be recompiled only when the header files it includes directly are changed.

    This solves the "only one include file" problem AC mentions, and means the source and include files are identical to the non-PCH version.

    The danger is that there might creep in hidden dependencies, i.e. source files that does not include all the headers they should, yet compile due to the pre-include of all.h. So you will have to make an occational build without PCH.

  113. Re:Hmph by devphil · · Score: 1


    I'm not counting TC1 as part of the language until the public actually has access to it (for a fee or otherwise). It's still only available to committee members at present.

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  114. Re:Hmph by devphil · · Score: 1


    In fairness, I should point out that I don't know how to do most of this either. But I don't complain about volunteer work not living up to my expectations...

    --
    You cannot apply a technological solution to a sociological problem. (Edwards' Law)
  115. Re:this is all well and good by TrancePhreak · · Score: 1

    With comments like this, I'm surprised it compiles at all. Please find some non-hacked together code to put me on trial by.
    "Added a hack to seek past raw video data in a system stream"

    --

    -]Phreak Out[-