This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bug in compiler

I,ve installed the Compiler and I can,t get even the simplest code to compile properely.

Anyone know where the fix for this bug is?

Or is it a limit of the demonstration version?

void main(void)
{ cout << "Hello world!";
}

Parents Reply Children
  • The problem you are going to run into if you use the Ceibo + Keil
    and you reply

    void main(void)
    { printf("Hello world\n");

    while(1);
    }

    where does the Ceibo C++ come in, in the above mr smokied sardine

    Oh dear, here we go again.

    I quoted two sentences as follows:

    As I have said before: The problem you are going to run into if you use the Ceibo + Keil combination is that the evaluation version of Keil C51 only allows a code size of 4 kB. Any complex string formatting function (this includes printf and cout) will easily need upwards of 10 kB code space.

    You snipped this down to half a sentence:

    The problem you are going to run into if you use the Ceibo + Keil

    Thereby removing all the content I was actually replying to.

    You then quoted part of my response, this time snipping out all the text that gave meaning to the code snippet.

    Go back and read my post again. If you still do not understand it let me know and I will explain it to you in whatever level of detail is necessary.

  • Go back and read my post again. If you still do not understand it let me know and I will explain it to you in whatever level of detail is necessary.

    I do not give a hoot about your post, the subject of this thread is NOT that printf works in C, which we all know, but C++ on the '51.

    Erik

  • Erik,

    I think in this case you really have missed Jack's point. He was showing the m51 file to indicate the using printf() in Keil didn't increase the code by 10kB, but rather by 1kBish which was an order-of-magnitude less "badness" than the original statement. It had nothing to do with C++, but was just continuing illustration of what he sees as bad in the responses on this forum -- namely that sometimes the estimates people provide from experience can be exaggerated and overly-emphatic.

    Also, just as a point of reference for your future usage: The name he's chosen (Jack Sprat) doesn't have anything to do with sardines. It's from an old nursery-rhyme (though I don't know it's origin) that begins like this: "Jack Sprat could eat no fat. His wife could eat no lean."

    -Jay Daniel

  • Also, just as a point of reference for your future usage: The name he's chosen (Jack Sprat) doesn't have anything to do with sardines.

    I know that, but sardines are canned :)

    Erik

  • "[Jack Sprat] was showing the m51 file to indicate the using printf() in Keil didn't increase the code by 10kB, but rather by 1kBish"

    But did it show that?

    It showed that the size of ?PR?PRINTF?PRINTF is 1K-ish, but it doesn't consider what other stuff may also get pulled-in as a result of having printf that wouldn't other wise have been included.

    I haven't had the time for a detailed look at the map file, but the summary line from building a simple "Hello, world" example as shown indicates that the total CODE space usage is on the order of 2K...

    It probably also varies with the Memory Model chosen...

    So: still not 10K, but it certainly does show that a simple printf can easily use up virtually the whole CODE size limitation of the Evaluation version...!

  • I haven't had the time for a detailed look at the map file, but the summary line from building a simple "Hello, world" example as shown indicates that the total CODE space usage is on the order of 2K...

    A quick glance would be sufficient to spot the following line:

    C:000000H   C:000000H   C:007FFFH   000438H   CODE
    

    Which shows the total code size to be 1080 bytes.

  • I do not give a hoot about your post, the subject of this thread is NOT that printf works in C, which we all know, but C++ on the '51.

    As usual you are commenting on what you would like me to have said, or what you imagine I have said, rather than what I actually have said. If you had the wit to read and understand my post you might be able to make some sort of sensible contribution.

    I'm quite happy for you to criticise anything I write on this forum, but please don't keep muddying the waters by criticising things I haven't written. It wastes even more bandwidth than I already expend trying to get you to stick to the facts.