|
KT Lee- This is a customer support engineer reporting your incident, not a CCS design engineer. I doubt it will be changed in any future version of CCS. The issue still is: you are on C54x under CCS, only 16-bit pointers are supported. When you type cast a 16-bit pointer to a "long int" what are you doing? Will that produce a defined value? Is there a possibility a negative value will cause incorrect pointer arithmetic? Maybe the compiler is trying to tell you something :-) It's not unlike a warning like "conversion between incompatible types; some data may be lost", or similar. Did you try (unsigned long int) typecast? Does it have the same result? -Jeff -------- Original Message -------- Subject: Re: [code-comp] Re: warning: pointer points outside of underlying object Date: Thu, 12 Feb 2004 17:28:24 +0900 From: "Kyungtae Lee" <> To: "Andrew Nesterov" <>,"Jeff Brower" <> CC: <> References: <> <> <> <008101c3f03c$0baa73d0$c7c7c7c7@ktlee> Hi, About the warning message, I got the below mail from TI technical support. Please refer to below. ---- Hello Kay, This is regarding case 35342600 opened with TI Customer Support for the following problem: "Compiler generates warning for printf("0x%lx\n", 0x10000 + ((long int)&global_var)); as follows: "warning: pointer points outside of underlying object" and the code does not execute correctly." I was able to reproduce this behaviour of the tool on CCS2.2. I have filed bug report SDSsq35431 for reporting this behaviour. The concerned engineers will be analyzing this bug report and taking the necessary action so that the bug can be fixed in a future version of the tool. Thank you for reporting this issue to us. ----- KT. ----- Original Message ----- From: Kyungtae Lee To: Andrew Nesterov ; Jeff BrowerCc: : Wednesday, February 11, 2004 10:11 AMSubject: Re: [code-comp] Re: warning: pointer points outside of underlying object Hi Jeff & Andrew, Thanks for you comments. By the way, I cannot figure out Jeff's. I just hoped to get the value, the address of global_var plus 0x10000. Please tell me in detail about "undefined memory" and "overwriting it." Furtheremore, what's the difference between the first code and the second code? About the 0x10000L, that makes no difference, Andrew. KT ----- Original Message ----- From: Jeff Brower To: Andrew NesterovCc: : Wednesday, February 11, 2004 5:47 AMSubject: Re: [code-comp] Re: warning: pointer points outside of underlying object Andrew- > Submit a bug report to either <> or <>. > > Syntactically, the program (both instances) is absolutely > valid. It compiles fine with other compilers, including those > that have different size for all, pointers, ints, long ints. > > The bug seem to be quite arbitrary, is there a chance that > 0x10000L for "long int" might improve the situation? The bug is in KT's code. He said he was using C54x, which means he's either reading undefined memory (best case) or overwriting it (worst case, depending on what the compiler does). Please see my earlier post. -Jeff > Andrew > > > Date: Tue, 10 Feb 2004 02:47:06 -0000 > > From: "kt_rhee" <> > > Subject: warning: pointer points outside of underlying object > > > > Sorry. Although I posted this message C54x group already, I thought > > this group may be proper me to ask this question. So I copy the > > message. > > > > ----- > > > > Hi, > > > > I encountered the warning message like below. > > > > "warning: pointer points outside of underlying object" > > > > The code which generate the warning message is below : > > > > int global_var = 5; > > int main(){ > > long int t; > > printf("0x%lx\n", 0x10000 + ((long int)&global_var)); > > } > > > > This didn't work as I expected. The printed value is not correct. > > What's the warning message? > > > > > > Strangely, I could avoid the warning when I modified the code > > slightly like below. > > > > int global_var = 5; > > int main(){ > > long int t; > > printf("0x%lx\n", 0x10000 + (t=(long int)&global_var)); > > } > > > > In this case, the CCS didn't generate the warning message and I could > > see the correct printed value. > > > > Any comment or idea? > > > > Best Regards, > > KT |