Thread: strange compiler

  1. #16
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Quote Originally Posted by @nthony View Post
    It's a shame the english language isn't completely boolean quantifiable huh?

    Hope is the first step on the road to disappointment.

  2. #17
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    The edge of the known universe
    > Quincy 99
    > Code::Blocks
    > Dev-C++
    You do know the difference between an IDE and a compiler right?

    Because all of those things are IDEs which basically come 'out of the box' with the MinGW port of gcc as the actual compiler.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #18
    Registered User
    Join Date
    Apr 2007
    Quote Originally Posted by Salem View Post
    VLA's are essentially useless candy IMO.

    The biggest problem is what happens if your VLA no longer fits on the stack (assuming that is where VLAs get created on a given machine). Even the best scenario results in the program being killed by the OS. On an embedded system, it probably just trashes someone else's memory. Nor is there a way of finding out in advance whether it will succeed or not, just close your eyes, pray and take a jump.

    Of course, a lot of naive programmers are going to take unchecked user input, and create their VLA directly from that. Most of them won't even bother to check for negative numbers, nevermind huge positive numbers.

    At least with malloc, there is a clearly defined way of being told there is no more room, and from there you can take appropriate action.
    Yes all true, but it has a place. If you need scratch memory allocated dynamically it can be quite convenient. For example if I'm doing a bunch of matrix operations, or even a bunch of rotations using quaternions for graphics applications, I'd like to be able to allocate some temp memory of small but possibly unknown size; use it for my calculations and then discard it.

    I suppose also, if you want to get a little more sophisticated you can try to increase your stack size. I know how to do that in assembly language, but I'm not sure about the various C compilers. Microsoft no doubt has some pragmas that support it and maybe gcc does to. Unfortunately MS has decided in recent versions of their compilers that inline assembly is simply not necessary any more.

  4. #19
    Registered User
    Join Date
    Apr 2007
    Quote Originally Posted by @nthony View Post
    uh... you mean to say *fully* compliant, right? because:
    Quincy 99
    Pelles C
    are all free, and all run on Windows.
    quincy 99 is a bit obscure but I'd love to find out more about it. Is it a preprocessor that outputs C code? Is it fully C99 compliant eg VLAs and complex number support?

    Dev-C++ will be gcc based and hence has their C99 limitations (eg no VLAs and no complex number support). By the way the reason why I want C99 complex number support is that a complex number is essentially double c[2] ; an array of 2 doubles. That plays nicely with Fortran which is why they chose this.

    Pelles I am well aware of. It is missing several C99 features as well. VLAs are only partially supported, if they are dirt simple. I don't think for example you could dynamically allocate an array of pointers to some other complex type and I don't think it would allocate multidimensional arrays (not that I ever use C multi-D arrays.) Also of course, no one supports complex.

  5. #20
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Quote Originally Posted by SevenThunders View Post
    By the way the reason why I want C99 [...]
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  6. #21
    Registered User
    Join Date
    Apr 2007
    Quote Originally Posted by Dave_Sinkula View Post
    Yup I've seen the list. Have you seen the price list? I think Dinkumware's C99 libraries are about $200 and then the front end from Edison Design costs some money, and then you still need a valid C89 compiler, which I suppose you could get for free. Then there is the cost of an IDE if you use that sort of thing and who knows if it plays nicely with C99 etc. etc.

    In other words the support for C99 isn't exactly overwhelming.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Strange results using dnsapi and windns
    By Niara in forum Networking/Device Communication
    Replies: 3
    Last Post: 08-13-2005, 10:21 AM
  2. Have you ever written a compiler?
    By ammar in forum A Brief History of
    Replies: 21
    Last Post: 12-27-2004, 07:10 AM
  3. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 06:13 AM
  4. lcc win32 compiler download problems
    By GanglyLamb in forum A Brief History of
    Replies: 5
    Last Post: 08-01-2004, 07:39 PM
  5. simple error or strange compiler?
    By threahdead in forum C Programming
    Replies: 6
    Last Post: 01-20-2003, 03:00 PM