Hi all,
        I couldn't find the contact information for the CW6 beta
information, so I'm posting my findings to this site in hopes it goes to the
right people.  Anyway, here's the problem I'm seeing:

If I try to add an item to a vector with 32 members it seems to crash.  For
example, I placed the following code before the main event loop:

        vector <char> v;
        int i;
        
        for(i=0;i<NUM_LETTERS;i++)
        {
          v.push_back((i % 26) + 'A');
        }


This code simply puts a #defined amount of letters onto a vector of chars.
If NUM_LETTERS is defined to be larger than 32, this code will crash in the
"uninitialized copy" section of the vector push_back function.  On the
emulator this simply causes the program to pause and go back to the debugger
(but you cannot execute past this point), but on the palmIII it causes a
fatal exception.
        
If the NUM_LETTERS value is less than 32, the code executes without any
problems.

Note, I also had to use some defines to get the <vector> include to work.
My defines are as follows:

        #undef min      
        #undef max      
        #pragma warn_implicitconv off   
        #pragma warn_notinlined off             

        #include <vector>
        using namespace std;

        #define NUM_LETTERS 33


I'm not sure if this is a problem in CW5, but it certainly is in CW6 beta.
This program has little more code than I posted above (the rest is from the
c++ starter template). I would be very surprised if any of the starter
template code is the problem.

 It'd be nice if vectors worked on the palm (even just for prototyping
programs).  I'm hoping this message makes it to the CW6 development group,
so if someone can forward it to them, I would appreciate it.  I'm reasonably
sure this is a compiler problem.  Thanks!

David Korus

Reply via email to