"le.c", line 3: Warning: Variable z in function main might be used
uninitialized
2012/7/16 Sun Chan <sun.c...@gmail.com>
> yes, and you will report which line num?
> Sun
>
> On Mon, Jul 16, 2012 at 11:13 AM, shenrfen <shenr...@gmail.com> wrote:
>
>> Hi, sun.****
>>
>> 我没太看懂你说的意思呢。****
>>
>> int main()****
>>
>> {****
>>
>> int z;****
>>
>> return z;****
>>
>> }****
>>
>> 这个就是完全没有初始化的例子吧?****
>>
>> ** **
>>
>> ** **
>>
>> *发件人:* Sun Chan [mailto:sun.c...@gmail.com]
>> *发送时间:* 2012年7月16日 11:01
>> *收件人:* shenrfen
>> *抄送:* Shin-Ming Liu; liwei.zh...@simplnano.com;
>> open64-devel@lists.sourceforge.net
>> *主题:* Re: 答复: [Open64-devel] 答复: Code review request : Add Location info
>> for ST(New feature)****
>>
>> ** **
>>
>> so your change reports defining place of partially uninitialized var.****
>>
>> When it is totally uninitialized (I assume this will either be heap
>> object, such as from malloc, or locals), how do you deal with it?****
>>
>> Sun****
>>
>> On Mon, Jul 16, 2012 at 10:55 AM, shenrfen <shenr...@gmail.com> wrote:***
>> *
>>
>> Hi, shin.****
>>
>> Thx for you review.****
>>
>> Yes. ****
>>
>> The location info is where the ST is declared.****
>>
>> In this case, it is line 3.****
>>
>> “Initialize” should be immediate followed with declaration in my opinion.
>> So I report Line 3.****
>>
>> ****
>>
>> *发件人:* Shin-Ming Liu [mailto:shinm...@gmail.com]
>> *发送时间:* 2012年7月16日 10:50
>> *收件人:* shenrfen
>> *抄送:* Sun Chan; liwei.zh...@simplnano.com;
>> open64-devel@lists.sourceforge.net
>> *主题:* Re: [Open64-devel] 答复: Code review request : Add Location info for
>> ST(New feature)****
>>
>> ****
>>
>> Do you report the unitialized variable defined at line 3, with your
>> change?****
>>
>> It is more reasonable to report the issue the warning at line 4, where
>> the return statement is referencing it.****
>>
>> ****
>>
>> - Shin****
>>
>> On Sun, Jul 15, 2012 at 7:28 PM, shenrfen <shenr...@gmail.com> wrote:****
>>
>> Hi, sun****
>>
>> Sorry for later reply.****
>>
>> There is an optimization called warn_uninitized_var in WOPT
>> phase.****
>>
>> ****
>>
>> Test case: 1.c****
>>
>> int main()****
>>
>> {****
>>
>> int z;****
>>
>> return z;****
>>
>> }****
>>
>> ****
>>
>> CMD:****
>>
>> opencc 1.c -WOPT:warn_uninit=1****
>>
>> ****
>>
>> Building output:****
>>
>> "1.c": Warning: Variable z in main might be used uninitialized****
>>
>> ****
>>
>> Error:****
>>
>> There is missing line number of variable, Which is difficult to
>> locate variable.****
>>
>> ****
>>
>> ****
>>
>> And If there is “.h” file in source code, The file name is also
>> error.****
>>
>> ****
>>
>> So I add “SRCPOS location” field for ST.****
>>
>> ****
>>
>> *发件人:* Sun Chan [mailto:sun.c...@gmail.com]
>> *发送时间:* 2012年7月15日 9:02
>> *收件人:* shenrfen
>> *抄送:* open64-devel@lists.sourceforge.net; wendong.w...@simplnano.com;
>> liwei.zh...@simplnano.com
>> *主题:* Re: Code review request : Add Location info for ST(New feature)****
>>
>> ****
>>
>> can you explain why the new field? Why? What problem are you solving?
>> Sun****
>>
>> On Thu, Jul 12, 2012 at 6:21 PM, shenrfen <shenr...@gmail.com> wrote:****
>>
>> Hi, all.****
>>
>> ****
>>
>> I would like add location info for Symbol tab.****
>>
>> ****
>>
>> Could you please give a review? ****
>>
>> Any question please let me know. ****
>>
>> Any suggestion is welcome.****
>>
>> Thx very much.****
>>
>> ****
>>
>> Class ST {****
>>
>> ...****
>>
>> SRCPOS location; // location where define symbol****
>>
>> }****
>>
>> ****
>>
>> *Main work:*****
>>
>> (1) Add location info for ST at wgen phase****
>>
>> (2) Remap location info at inline phase****
>>
>> a) Remap Global st is the technical difficulties****
>>
>> (3) Remap location info at IPA phase****
>>
>> (4) Fix bug when �CIPA:dst=on****
>>
>> a) Add abstract_dst info for DST_INLINED_SUBROUTINE****
>>
>> ****
>>
>> DST_INFO_IDX abstract_origin; /* The abstract version of this
>> instance */****
>>
>> + DST_TYPE abstract_dst; /* dst where abstract_origin is
>> located */ ****
>>
>> ….****
>>
>> } DST_INLINED_SUBROUTINE;****
>>
>> ****
>>
>> *New option:*****
>>
>> (1) Trace_IPA_Remap_Symtab_File_Num ( �CWj,-tt19:0x200000 )****
>>
>> (2) �CIPA:dst=on/off (dst merge is done at inline phase)****
>>
>> a) In previous version, this option is disable.****
>>
>> * *****
>>
>> *The followed tests have been done:*****
>>
>> (1) there was only one dst finally, all function has been inlined****
>>
>> (2) there was more than one dst finally, some function cannot be
>> inline****
>>
>> (3) more than 4 level inline(global st and local st)****
>>
>> (4) all function is in one file & only one function in one file &
>> middle case****
>>
>> (5) Inline = on/off ****
>>
>> (6) Nucleus Os can be passed, All local st and global st are checked.
>> ****
>>
>> ****
>>
>> Best Regards****
>>
>> RuifenShen****
>>
>> ****
>>
>> ****
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Open64-devel mailing list
>> Open64-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/open64-devel****
>>
>> ****
>>
>> ** **
>>
>
>
--
Best Regards.
Shen Ruifen
tel: 010-51266989-226
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Open64-devel mailing list
Open64-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/open64-devel