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.
"Kind of flaming" just means that you nearly flamed me.
Yes, and "nearly flamed" makes about as much sense as "nearly pregnant".
You may consider youself flamed if you see certain four-letter words and clearly derogatory insults (idiot, moron, and the like).
Always depends on the point of view. The one driving on the (apparently) wrong lane always thinks any other driver is on the wrong lane.
The driver who thinks that he's in the correct lane and everyone else isn't needs to have his license yanked as soon as possible, and probably needs to seek medical help.
I'll explain to you what I meant. To find one certain line of the many code examples in >100s posts in this thread is not easy, because I don't read any post, of course (uses too much time).
The first posting that mentions an explicit cast as the solution to your problem is the second response (the first response to the original posting was actually written by you. Reading the second posting takes too much time ? That does not make sense.
Actually not. I never said you are wrong.
Oh yes you do. We are wrong for not following along with your made-up terminology. That statement is pretty much implied in any of your postings on the matter.
Correct me if you need to, but I understand "convert" as "turn into" or "change". The target is ptr_xdata and the source is stPtr_Obj->Adresse.
O ... kay.
The line in question tells the compiler the following:
1. Take the value of stPtr_Obj->Adresse. 2. (implicit) Convert this value to the datatype of ptr_xdata if necessary. 3. Assign this value to the variable ptr_xdata.
Step 2 involves turning a non-pointer (the value of stPtr_Obj->Adresse) into a pointer (the data type of ptr_xdata). This is very clear to the compiler, since the C standard demands it. If you think the compiler should not adhere to the C standard, but follow your line of thinking, then you need to write your own compiler (possibly with your own programming language, since that compiler won't qualify as a C compiler).
Oh, "implicit conversion"! Wow, what an intelligent phrase.
It's not about intelligence. It's about the terminology used in the C standard and the literature. It's about the terms that seasoned C programmers will use and understand. It's about being concise and getting your point across.
You don't need to be intelligent to use the correct terminology. However, you need to want to use the correct terminology, and this seems to be somewhat lacking. You are posting in English, so you're following some of the conventions. What's so difficult about going all the way and actually using the right terms ?
In my humble silly words: the pointer is set. Set to a value which represents an address of a variable, which makes the pointer point to that variable.
The compiler does not care about "represents". It does not know what a variable is supposed to represent. It cannot read you mind. For the compiler, you are assigning an integer to a pointer, and this requires a type conversion.