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.
Or "a pointer's value" has the same meaning as "the value of a pointer
Afaik, a pointer points to a value, but it doesn't have one.
"Address is defined as a target, at least in my language"
Again, not in English.
You sure? A data packet in the internet is sent to an address, the IP. Network hardware has a MAC address, where data is addressed to. If you send a letter, you send it to an address. Perhaps I should have written destination instead of target. It's sometimes not easy to distinguish between multiple words in English (target, aim, goal, destination) that have only one meaning in German (Ziel).
But still, if a pointer points to a pointer, I don't need to care about both pointer locations. This is C, so I don't care about memory addresses. This is a matter of opinion, but I don't find it very elegant to put a pointer to a pointer...
I'm also not the super programmer like you folks seem to be. I rather do many things in my life than just learning a computer language down to its deepest meaning. What counts is that it has to work. And it does! Even without non-sense warnings of a picky compiler.
Afaik, a pointer points to a value, but it doesn't have one.<p>
Well, I'm afraid your knowledge is wrong, then.
A pointer, like any other variable, has an address (where it is stored), and a value (which can be used to access a certain location in memory). A pointer does not need to point to a value.
Example:
void * some_void_ptr
some_void_ptr is a pointer. At least as far as the compiler is concerned, it does not point to a value. Hence, the compiler cannot, for example, increment it:
some_void_ptr++;
will result in an error. It also cannot dereference it:
*some_void_ptr = 0;
will also result in an error.
However, you can take the address of this pointer, for example:
void ** some_ptr_to_void_ptr; some_ptr_to_void_ptr = &some_voidptr;
This is C, so I don't care about memory addresses.
C is still way too close to the actual hardware to ignore the target platform. The C compiler will not save you from alignment faults and access penalties that stem from "not caring about memory addresses".
I rather do many things in my life than just learning a computer language down to its deepest meaning. What counts is that it has to work. And it does! Even without non-sense warnings of a picky compiler.
You are not the only one with that attitude round here.
That attitude is fine for a hobby programmer, but unfortunately is the reason why the world is full of unmaintainable, unreliable software.
You sure? A data packet in the internet is sent to an address, the IP. <p>
No, it is not. The packet is sent to a destination. There are _two_ addresses in a packet, a source and a destination.
Network hardware has a MAC address, where data is addressed to.
The MAC of a NIC is a property of the NIC itself. It only becomes a destination/target if it is put in the right field in the network packet.
If you send a letter, you send it to an address.
A house has an address, which describes its location. It becomes a destination/target when it is written on the right part of the envelope.
So, I think that's part of the problem. You're saying "address" when you mean "destination/target", while everyone else (and all available literature) defines "address" as "location/place".