Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
01/15/05 14:17
Read: times


 
#85012 - That Array!
Responding to: ???'s previous message
the Tasking Demo compiles this array without complaining, and the generated data looks right:
char key_tbl1[][] =
{
    {   4,   3,   2,   1 },    // row 0
    {   8,   7,   6,   5 },    // row 1
    {  12,  11,  10,   9 },    // row 2
    {  16,  15,  14,  13 },    // row 3
};

Jon Ward said:
What about this array?
char key_tbl[][] =
{
    {  1           },    // row 0
    {  2, 3        },    // row 1
    {  4, 5, 6     },    // row 2
    {  7, 8, 9, 10 },    // row 3
};


No, it rejects that.
It gives Error E143 "Too many initialisers" once on row 1, twice on row 2, and thrice on row 3

In a quick scan (searching the PDF), I couldn't see anything about this in the Manual.

Jon Ward said:
Clearly, the compiler cannot process the data in sequential order. It must go back and adjust the number of items in each preceeding row for each new row processed.

It looks like Tasking just assumes that the first initialiser must fully initialise all the elements of that "row"?

Jon Ward said:
After reading the C99 specification, I'm not convinced that initializations of multidimensional arrays with more than one unspecified dimension are addressed ... Since this would be a completely new feature of the language, you would think that the C99 specification would include a few examples of such a thing. It doesn't.

My thoughts exactly!



List of 32 messages in thread
TopicAuthorDate
Philips sample code/Keil problems            01/01/70 00:00      
   Why don't you ask Philips?            01/01/70 00:00      
      Re: Why don't you ask Philips?            01/01/70 00:00      
         Re: Ask Philips?            01/01/70 00:00      
            Re: Ask Philips?            01/01/70 00:00      
               Link            01/01/70 00:00      
                  Re: useful App Note            01/01/70 00:00      
                     87 89            01/01/70 00:00      
                        Re: 87 89            01/01/70 00:00      
               Tasking.            01/01/70 00:00      
                  Re: Tasking            01/01/70 00:00      
                     Keil?            01/01/70 00:00      
                        Re: Keil            01/01/70 00:00      
                           Linking            01/01/70 00:00      
                              Linked!            01/01/70 00:00      
                                 Re: Linked            01/01/70 00:00      
                                    Linking            01/01/70 00:00      
                  Re: Tasking            01/01/70 00:00      
         reply            01/01/70 00:00      
   Dunfields or Tasking?            01/01/70 00:00      
      Tasking            01/01/70 00:00      
   2D Array problem            01/01/70 00:00      
      Compiler can deduce size.            01/01/70 00:00      
         can, but doesn't have to!            01/01/70 00:00      
            Fully Bracketed Initializers            01/01/70 00:00      
               Ask Keil            01/01/70 00:00      
               C99 vs. C90            01/01/70 00:00      
         Compiler deducing array size            01/01/70 00:00      
            Tasking Compiler deduces array size!            01/01/70 00:00      
               Which Array?            01/01/70 00:00      
                  That Array!            01/01/70 00:00      
                     One More Test            01/01/70 00:00      

Back to Subject List