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.
"I call the address the pointer points to the pointer address."
In your own little world, you can call it what you like. You just have to understand that it is completely contrary to what the rest of the world understands by that term. It also suggests that you have not fully grasped what's going on.
"The address where the pointer itself is located or managed, I call base address"
That is also contrary to the generally-accepted meaning of that term. A "base" address is generally accepted to mean the datum (or reference) from which an offset or relative address is calculated.
" But this address is commonly not used in consideration"
Oh yes it is!
As Per said, having a pointer to a pointer is quite common; in fact, the C51 compiler supports up to 19 levels of indirection! http://www.keil.com/support/man/docs/c51/c51_xd.htm
It is also common to need to know the address (ie, location) of a pointer when debugging...
"When I'm writing C, then it's painful enough to fulfill the microprocessor's picky demands"
Yes - you can get away with sloppy terminology when talking to other people, but not when talking to a compiler!
If you think 'C' is picky, you should try writing in Pascal or Ada...
Assembler may seem less "picky", but that just puts even more responsibility on the programmer to ensure that they have everything right!
"I don't want to care about if the pointer's base address (sic) consists of two or three bytes"
In general, you don't need to - it's only when you start trying to assign a non-pointer value (such as a uint) to a pointer that you need to be really sure of what you are doing...
"Only if I wouldn't have enough RAM."
No, that has nothing to do with it! If you mess up a pointer, it can point to absolutely anywhere in memory, and do untold damage.
That's why pointers in 'C' are both so powerful and so dangerous!
Which is why it is so important that you have a really firm understanding of what's going on.
Which is why compilers tend to give warnings when there's any doubt...
"Back to my problem: Putting a cast in front of the particular line did not succeed"
Show exactly what cast you used!