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
  • What is "kinda flaming" ? Is that along the lines of "kinda pregnant" or "kinda dead" ?

    Wow, you native english-speaking guys (are you?) seem to be very sophisticated about terms. "Kind of flaming" just means that you nearly flamed me. Flaming just means, at least for me, that someone was blamed or accused of something without the need to do so.

    If you're driving on the highway and hundreds of cars are coming your way, it's most likely because you're in the wrong lane.

    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.

    Hidden ? How can it be hidden ? The text on my screen is quite high contrast (black on very light grey). In fact, you have stated that you tried doing a cast and that it did not help, and then you've been asked repeatedly to post the line containing the cast so we can check whether it is correct, with no response from your part.

    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 most ones where not really helpful. So I just found it was hidden, because it does not pop out so clearly that you see it at the first glance.

    Hum hum. Is that you "kinda flaming" us ?

    Actually not. I never said you are wrong. But you keep telling me. Just because I have a different view, I'm wrong in your eyes. No comparisons!

    Because when it says "conversion: non-pointer to pointer" for the line of code above, then it's clear for me that ptr_xdata is meant.
    Why ? The line says that a non-pointer is getting converted to a pointer. ptr_xdata quite clearly is a pointer, so it cannot be a non-pointer. Why does this line make it clear to you that ptr_xdata is being converted ?

    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. Since the source is never converted (or changed) in such a case, ptr_xdata is the subject to be converted and that's why the warning does not makes, because it's actually not converted.

    And you're doing it again ! You're again making up terms ("indirectly set") for something that already has a clear and concise term ("implicit conversion/typecast")...

    Oh, "implicit conversion"! Wow, what an intelligent phrase. Forgive me if I'm not intelligent enough to create such phrases because my native language is not english and that I'm not learning such phrases in order to use them so that you can understand me, while "setting a pointer" turns out to be completely incomprehensible. I should be learning another meaning of the word "conversion" than I always had in my life, just to understand "implicit conversion" as you seem to understand it. For me, a conversion is still a change of type/form/shape, but the pointer is not changed in his type, it is only set to point to a new address. 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.

Reply
  • What is "kinda flaming" ? Is that along the lines of "kinda pregnant" or "kinda dead" ?

    Wow, you native english-speaking guys (are you?) seem to be very sophisticated about terms. "Kind of flaming" just means that you nearly flamed me. Flaming just means, at least for me, that someone was blamed or accused of something without the need to do so.

    If you're driving on the highway and hundreds of cars are coming your way, it's most likely because you're in the wrong lane.

    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.

    Hidden ? How can it be hidden ? The text on my screen is quite high contrast (black on very light grey). In fact, you have stated that you tried doing a cast and that it did not help, and then you've been asked repeatedly to post the line containing the cast so we can check whether it is correct, with no response from your part.

    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 most ones where not really helpful. So I just found it was hidden, because it does not pop out so clearly that you see it at the first glance.

    Hum hum. Is that you "kinda flaming" us ?

    Actually not. I never said you are wrong. But you keep telling me. Just because I have a different view, I'm wrong in your eyes. No comparisons!

    Because when it says "conversion: non-pointer to pointer" for the line of code above, then it's clear for me that ptr_xdata is meant.
    Why ? The line says that a non-pointer is getting converted to a pointer. ptr_xdata quite clearly is a pointer, so it cannot be a non-pointer. Why does this line make it clear to you that ptr_xdata is being converted ?

    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. Since the source is never converted (or changed) in such a case, ptr_xdata is the subject to be converted and that's why the warning does not makes, because it's actually not converted.

    And you're doing it again ! You're again making up terms ("indirectly set") for something that already has a clear and concise term ("implicit conversion/typecast")...

    Oh, "implicit conversion"! Wow, what an intelligent phrase. Forgive me if I'm not intelligent enough to create such phrases because my native language is not english and that I'm not learning such phrases in order to use them so that you can understand me, while "setting a pointer" turns out to be completely incomprehensible. I should be learning another meaning of the word "conversion" than I always had in my life, just to understand "implicit conversion" as you seem to understand it. For me, a conversion is still a change of type/form/shape, but the pointer is not changed in his type, it is only set to point to a new address. 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.

Children
  • "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.