View Poll Results: Your most used C/C++ compiler?

Voters
40. You may not vote on this poll
  • MS Visual Studio

    22 55.00%
  • Borland

    2 5.00%
  • GCC

    25 62.50%
  • Other paid (Please post)

    1 2.50%
  • Other free (Please post)

    3 7.50%
  • Other open-source (Please post)

    3 7.50%
Multiple Choice Poll.

Thread: Your most used compiler

  1. #76
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    >> You can now proceed to http://gnu.org/even_more to receive your free, signed "RMS" beer stein -- made of solid 'pewter!

    You mean free...as in beer?

    >> Now see, those types of warning should be enabled by default, no?

    Sure and why not warn about the use of void pointers, or malloc, or any other thing that could cause problems? What's next - code formatting advice from the compiler?

    "Warning (Line 3114): the use of tabs is considered bad form".

    That isn't a compiler's job IMO. It's all about delegation of concerns. Hell, the compiler doesn't even know *a priori* what function you're linking to, so it really has no business making assumptions, anyway.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  2. #77
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by cpjust
    That's one of the functions of an IDE; but a good IDE also highlights code syntax, takes you directly to the lines causing compile errors, lets you debug code, does auto-completion as you type names of functions, has integrated help about classes/functions where you can just click on the name of the class/function and press a key to learn how to use it, shows you the type of a variable when you put your mouse over the variable name... All very useful things to have when programming.
    Along with syntax highlighting, auto indentation is a text editor feature, not something that involves tool integration. Even auto-completion and integrated help, especially where it is limited to the standard library (and perhaps specific other libraries) can be considered pure editor features, to some extent.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #78
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by whiteflags View Post
    Also I laughed at the whole security wizards thing. Thanks Elysia! It seems a wee contradictory that a bunch of "security wizards" would have so many security problems with their products. Really I don't see how microsoft is any more focused on security than any other company. Calling them security wizards because they tacked on a few warnings in their dev software suggests a very narrow perspective on what security is on the part of the claimant.
    Quote Originally Posted by cpjust View Post
    Symantec is a 'security wizard'. Microsoft is only starting to take security seriously, and they have a long way to go.
    Ah, but Microsoft spits out lots of security releases each month. They're also, while not a security company, very serious about security. They have released a lot of things related to security. Anti-virus tools, anti-malware tools, firewall, etc.
    And the "safer" C library functions.
    So I think it's fair to call them security wizards since they are very adamant about security.

    Quote Originally Posted by Sebastiani View Post
    Sure and why not warn about the use of void pointers, or malloc, or any other thing that could cause problems? What's next - code formatting advice from the compiler?

    "Warning (Line 3114): the use of tabs is considered bad form".

    That isn't a compiler's job IMO. It's all about delegation of concerns. Hell, the compiler doesn't even know *a priori* what function you're linking to, so it really has no business making assumptions, anyway.
    A compiler should possibly warn if malloc/void* was used in C++, if you ask me. Absolutely not in C, though, since they're integral there.
    A compiler is a tool to not only compile your code, but to catch your mistakes too (to a certain extent), so I think it's fair.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  4. #79
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by Elysia View Post
    Ah, but Microsoft spits out lots of security releases each month. They're also, while not a security company, very serious about security. They have released a lot of things related to security. Anti-virus tools, anti-malware tools, firewall, etc.
    And the "safer" C library functions.
    So I think it's fair to call them security wizards since they are very adamant about security.
    That just means that you're easily impressed. Watching microsoft play catch up after so many years of turning a blind eye and depending on third parties to meet the need is like watching a kid finally listen to a parent. And the new functions just have a new, different interface to understand, they don't prevent buffer overflows like an actual run-time environment will; you're kidding yourself. If you really don't need a run-time environment, then don't expect a whole lot of magic cast on your behalf.

  5. #80
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Eh, you're missing the point.
    Microsoft is concerned about security. Vista was all about security. They promote IE8 because of security, etc.
    So it wouldn't strike me as strange that they added "safe" functions.
    And btw, they're more like debugging tools than real functions, since they just throw an assertion. And I don't think they're difficult to understand. If you fail to understand them, then you shouldn't call yourself a C programmer.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #81
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Quote Originally Posted by Elysia View Post
    Eh, you're missing the point.
    Microsoft is concerned about security. Vista was all about security. They promote IE8 because of security, etc.
    So it wouldn't strike me as strange that they added "safe" functions.
    And btw, they're more like debugging tools than real functions, since they just throw an assertion. And I don't think they're difficult to understand. If you fail to understand them, then you shouldn't call yourself a C programmer.
    Again though, that's all new stuff; why be impressed by that now? It's what we expect, not exemplary.

    And shut up about my skills please. If you read what I said, I said new and different. And indeed, if you make a miscalculation in your buffer lengths all the asserts in the world will not prevent an out-of-bounds error. In a real run-time environment you do not have to supply the lengths of your arrays or lists to have this sort of check performed, so it always works. Microsoft basically tied a pretty bow on some functions.

  7. #82
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I'm not impressed.
    And if you know of a better way to detect such stuff in C, then name it.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #83
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Elysia View Post
    And if you know of a better way to detect such stuff in C, then name it.
    I do not have today the same annoyed expression I would have a couple of years ago when discussing the so-called "safe functions". However I still think these are at large useless since buffer overflow is first a bug before it ever becomes a security issue. None of these so-called "safe functions" offered by Microsoft or OpenBSD or even the C Standards Committee really address the issue, since they can only operate with the programmer's consent.

    Personally, I favor canary solutions like ssp. Especially ssp. Not StackGuard which is only marginally more useful than the so-called "safe functions" and which is what Microsoft uses with that /GS switch of them. In any case, these solutions plant the protection downstream at program compilation and execution. Exactly where it provides more safety. Not in the programmer's hand where usually all the damage comes from.

    I'd probably complement that with a standard library wrapper like Libsafe and ignore altogether the so-called "safe functions" (with the exception of C standard functions). So, there's one upstream solution (libsafe) and one downstream solution (ssp).

    Again, buffer overflow is first a bug before it ever becomes a security issue. If there is a need to actually solve the problem (solving = minimizing the impact) then this really has to be done by treating C and C++ programmers as they deserve; a bunch of incompetent fools that need their code to be nursed.

    EDIT: Naturally I said last bit because I felt it was something I needed to say. It annoys me the way we like to wash our hands of the buffer overrun problem as if it was a flaw of the compiler, or operating system, or whatever. But in all truth the point is that there are other, better solutions. "Safe functions" address the problem by putting the solution back in the hands of those that create the problem in the first place. There's no guarantee of success since most people actually don't use these functions. Some don't even know they can use OpenBSD's much better strlcpy in their standard library, for instance. Sure keep them around, but a real solution has to include elimination and prevention techniques like the ones described above.
    Last edited by Mario F.; 07-16-2009 at 03:28 PM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #84
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Mario F. View Post
    ...If there is a need to actually solve the problem (solving = minimizing the impact) then this really has to be done by treating C and C++ programmers as they deserve; a bunch of incompetents that need their code to be nursed.
    Harsh! But I like it
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #85
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545
    Quote Originally Posted by laserlight View Post
    Along with syntax highlighting, auto indentation is a text editor feature, not something that involves tool integration. Even auto-completion and integrated help, especially where it is limited to the standard library (and perhaps specific other libraries) can be considered pure editor features, to some extent.
    No, you're thinking of a particular subset of text editors which do more then just edit text.
    If you were using a real basic text editor like Notepad, there's no highlighting, auto-indenting or anything else.
    Also, editors like vi don't do anything special by default unless you turn on those features, and that would require the student to learn vi as well as C/C++, so why not just use an IDE to begin with? You don't have to compile with it if you really don't want to, but clicking 1 button to compile & run it couldn't get much simpler, could it?
    "I am probably the laziest programmer on the planet, a fact with which anyone who has ever seen my code will agree." - esbo, 11/15/2008

    "the internet is a scary place to be thats why i dont use it much." - billet, 03/17/2010

  11. #86
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by cpjust View Post
    That's one of the functions of an IDE; but a good IDE also highlights code syntax, takes you directly to the lines causing compile errors, lets you debug code, does auto-completion as you type names of functions, has integrated help about classes/functions where you can just click on the name of the class/function and press a key to learn how to use it, shows you the type of a variable when you put your mouse over the variable name... All very useful things to have when programming.
    I wasn't gonna say anything until I saw this:

    Quote Originally Posted by cpjust View Post
    Also, editors like vi don't do anything special by default unless you turn on those features, and that would require the student to learn vi as well as C/C++, so why not just use an IDE to begin with?
    You can do everything in the first paragraph with vim, you just have to figure out how to do it because the functionality is so "discrete". And altho vim is the best program of all time bar none, it is still just a text editor.

    Which maybe forces you to think about the issue a little more -- eg. "Why I am trying to figure out how to do this like this, even if it is possible?" Do you really want to be looking up commands using your text editor at the same time as you use it to program? Since the operating system is already an "integrated thing" aren't there already a whole bunch of ways right in front of your face to do this? You make it sound very nice, and then I think of looking at eclipse again and thinking wow, this is a neat idea but the reality of the implimentation reveals something about reality.

    Seperate tools is a better idea.
    Last edited by MK27; 07-16-2009 at 04:55 PM.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  12. #87
    Registered User Homer_Simpson's Avatar
    Join Date
    May 2009
    Posts
    22
    I use GCC.

  13. #88
    Disrupting the universe Mad_guy's Avatar
    Join Date
    Jun 2005
    Posts
    258
    GCC - it pretty much compiles everything. But I've been using clang more and more lately since it's got a whole host of things that I think make it a better compiler (for C anyway... right now,) and pretty full GCC compatibility as well.
    operating systems: mac os 10.6, debian 5.0, windows 7
    editor: back to emacs because it's more awesomer!!
    version control: git

    website: http://0xff.ath.cx/~as/

  14. #89
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by MK27 View Post
    Which maybe forces you to think about the issue a little more -- eg. "Why I am trying to figure out how to do this like this, even if it is possible?" Do you really want to be looking up commands using your text editor at the same time as you use it to program? Since the operating system is already an "integrated thing" aren't there already a whole bunch of ways right in front of your face to do this? You make it sound very nice, and then I think of looking at eclipse again and thinking wow, this is a neat idea but the reality of the implimentation reveals something about reality.
    That's what an IDE is for, MK.
    Some IDEs do this wonderfully (eg Visual Studio), and everything in one solution is always preferred to several programs to do it. That is, if it works as it should.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  15. #90
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by cpjust
    No, you're thinking of a particular subset of text editors which do more then just edit text.
    Not really: indentation is part of text editing, and syntax highlighting is a natural part of how text might be displayed. In fact, it sounds like you agree with me, since you call them text editors. If they do more than edit text, then they must have been integrated with some other tool, hence they are IDEs. That said, the lines between a powerful text editor and a lightweight IDE are blurred... but as mentioned I think the key to this differentiation is whether tool integration is required for a given feature (but distinguishing between a tool and a feature of a tool can be difficult, since IDEs themselves can be considered tools in their own right).

    Quote Originally Posted by cpjust
    If you were using a real basic text editor like Notepad, there's no highlighting, auto-indenting or anything else.
    Yes, but that has no bearing on whether those features are part of an IDE or can be part of a "mere" text editor.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM

Tags for this Thread