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
  • if you have a function fun(a,b,c,d) and you call it w/o a prototype how is the compiler to "know" that you have provided all parameters?

    Well, that's encouraging. It looks as though you do have some understanding of what a prototype is for.

    Thus, as far as the compiler "knows" there is "no guarantee that the call to the non-prototyped function will work"

    Ok, but I notice you have misquoted yourself. This is what you said before:

    no guarantee that all non-prototyped functions will work

    Which means something quite different.

    I suggest you read up in the Keil manual (this is NOT K&R) on 4 int functions and visualize what will happen if a 3 variable function w/o a prototype is called with 4 or more variables.

    I know what will happen. I think that if *you* knew what would happen, you wouldn't have made this suggestion. Go on, try it.

    Oh I'm sorry I forget that, although you post here, you have no interest whatsoever in the Keil documentation,

    I find it really strange that you say that - I always recommend reading the documentation.

    in your opinion, if it is not in K&R it does not exist.

    The 'C' language has been standardised for 18 odd years, so I use the standard as my reference, not K+R. For implementation dependant details and extensions to the standard language I refer to the relevant documentation.

Reply
  • if you have a function fun(a,b,c,d) and you call it w/o a prototype how is the compiler to "know" that you have provided all parameters?

    Well, that's encouraging. It looks as though you do have some understanding of what a prototype is for.

    Thus, as far as the compiler "knows" there is "no guarantee that the call to the non-prototyped function will work"

    Ok, but I notice you have misquoted yourself. This is what you said before:

    no guarantee that all non-prototyped functions will work

    Which means something quite different.

    I suggest you read up in the Keil manual (this is NOT K&R) on 4 int functions and visualize what will happen if a 3 variable function w/o a prototype is called with 4 or more variables.

    I know what will happen. I think that if *you* knew what would happen, you wouldn't have made this suggestion. Go on, try it.

    Oh I'm sorry I forget that, although you post here, you have no interest whatsoever in the Keil documentation,

    I find it really strange that you say that - I always recommend reading the documentation.

    in your opinion, if it is not in K&R it does not exist.

    The 'C' language has been standardised for 18 odd years, so I use the standard as my reference, not K+R. For implementation dependant details and extensions to the standard language I refer to the relevant documentation.

Children
No data