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

Compiling differences between C51 v7.03 and v8.06

Hello!

I have uVision that compiles fine with the C51 v7.03 compiler and the related package, but not complete with the 8.06. I used two different Keil installations. All files are in the same folder.

In the 8.06 I get linker errors like "object does not fit in to pdata page" and "0080H". This looks like the compiler was thinking the PDATA was only 128 bytes, but it is set to 256 bytes in the startup.a51. Any clue what's different in the newer Keil package?

Also there is a warning in 8.06 (which does not show in 7.03) "converting non-pointer to pointer" on this

ptr_xdata = sPtr_obj->Adresse;


while the vars are set like this:

uchar uc_set_obj( uchar pdata *ptr_Set)
{
   uchar i;
   uchar xdata *ptr_xdata;
   struct stOBJADR code *sPtr_obj;

   sPtr_obj=&Obj[*ptr_Set];
   .
   .
   .
   ptr_xdata = sPtr_obj->Adresse;
}


The struct stOBJADR has a member "uint Adresse;"

I can see no wrong use of the pointers. I just want to be sure that the warning does not affect the code to not work correctly.

Parents
  • "A pointer is slightly different."

    It still has an address at which it is stored, and a value which is stored in it - from that point-of-view, it is no different from any other variable.
    Hence there is no reason to give these properties different names - that only causes confusion.

    "It points to the value at the address. And how do you call this value?."

    It is called, very simply, the pointed-to value!

    "I have no other name than to call it the pointer's value (or pointed value)."

    Haven't we already established that doesn't make sense - either in English or in German?

    "The pointer's value" has identical meaning to "the value of the pointer" - the two expressions are equivalent.

    Just as "the car's colour" has identical meaning to "the colour of the car"

    And the value of the pointer (the pointer's value) is not at all the same as the value pointed to by the pointer!

    Try this:

    void main( void )
    {
       int  my_int = 1234;
       int *my_ptr = &my_int;
    
       printf( "The int's value is:            %d\n",   my_int );
       printf( "The value of the int is:       %d\n\n", my_int );
    
       printf( "The address of the int is:     %p\n",   &my_int );
       printf( "The int's address is:          %p\n\n", &my_int );
    
    
       printf( "The pointer's value is:        %p\n",   my_ptr );
       printf( "The value of the pointer is:   %p\n\n", my_ptr );
    
       printf( "The pointer's address is:      %p\n",   &my_ptr );
       printf( "The address of the pointer is: %p\n\n", &my_ptr );
    
       printf( "The pointed-to value is:       %d\n",   *my_ptr );
       printf( "The value pointed to is:       %d\n\n", *my_ptr );
    }
    


    My results with Borland on a PC are:

    The int's value is:            1234
    The value of the int is:       1234
    
    The address of the int is:     0012FF88
    The int's address is:          0012FF88
    
    The pointer's value is:        0012FF88
    The value of the pointer is:   0012FF88
    
    The pointer's address is:      0012FF84
    The address of the pointer is: 0012FF84
    
    The pointed-to value is:       1234
    The value pointed to is:       1234
    

Reply
  • "A pointer is slightly different."

    It still has an address at which it is stored, and a value which is stored in it - from that point-of-view, it is no different from any other variable.
    Hence there is no reason to give these properties different names - that only causes confusion.

    "It points to the value at the address. And how do you call this value?."

    It is called, very simply, the pointed-to value!

    "I have no other name than to call it the pointer's value (or pointed value)."

    Haven't we already established that doesn't make sense - either in English or in German?

    "The pointer's value" has identical meaning to "the value of the pointer" - the two expressions are equivalent.

    Just as "the car's colour" has identical meaning to "the colour of the car"

    And the value of the pointer (the pointer's value) is not at all the same as the value pointed to by the pointer!

    Try this:

    void main( void )
    {
       int  my_int = 1234;
       int *my_ptr = &my_int;
    
       printf( "The int's value is:            %d\n",   my_int );
       printf( "The value of the int is:       %d\n\n", my_int );
    
       printf( "The address of the int is:     %p\n",   &my_int );
       printf( "The int's address is:          %p\n\n", &my_int );
    
    
       printf( "The pointer's value is:        %p\n",   my_ptr );
       printf( "The value of the pointer is:   %p\n\n", my_ptr );
    
       printf( "The pointer's address is:      %p\n",   &my_ptr );
       printf( "The address of the pointer is: %p\n\n", &my_ptr );
    
       printf( "The pointed-to value is:       %d\n",   *my_ptr );
       printf( "The value pointed to is:       %d\n\n", *my_ptr );
    }
    


    My results with Borland on a PC are:

    The int's value is:            1234
    The value of the int is:       1234
    
    The address of the int is:     0012FF88
    The int's address is:          0012FF88
    
    The pointer's value is:        0012FF88
    The value of the pointer is:   0012FF88
    
    The pointer's address is:      0012FF84
    The address of the pointer is: 0012FF84
    
    The pointed-to value is:       1234
    The value pointed to is:       1234
    

Children
  • "I still don't get why setting a pointer of type uint..."

    STOP right there!

    That is your basic problem: there is no such thing as "a pointer of type uint"

    What you have is a pointer to type uint

    "why it is called conversion."

    Because they are different types!

    "uint" is a type and "pointer to uint" is a different type!

    "For me it is an assignment. Something totally different to a conversion"

    No - it is an assignment that involves a conversion!

    Just as assigning from a float to a uint would involve a conversion (from float to uint).