Here's another example that doesn't work quite right now, and could be used
as motivation to use a full source coordinate, rather than just line number:
$ cat testa.c
int main ()
{
#include "z.h"
return z;
}
$ cat z.h
int z;
$ opencc -O -Wuninitialized -c testa.c
testa.c: In function 'main':
testa.c:: warning: Variable z in main might be used uninitialized
Steve.
shenrfen wrote:
> Hi, jianxin.
>
> Thx very much for your suggestion.
>
>
>
> (1) SRCPOS is defined to mUINT64.
>
> In fact, mUINT32 is big enough for line number even if 16bit machine.
>
> And in gcc-front-end, decl_line is declared as INT.
>
> (2) IN STMT_NODE, linenum is defined as mUINT64, not a macro
>
> If use a macro to define line in ST,
>
> The print format will take a little bit more work
>
>
>
> *From:* Jian-Xin Lai [mailto:[email protected]]
> *Sent:* Wednesday, October 12, 2011 3:19 PM
> *To:* shenrfen
> *Cc:* [email protected]
> *Subject:* Re: [Open64-devel] Please help to review the patch for [Bug
> 879]: Missing line number of uninitialized variable warning
>
>
>
> I mean replacing the type of the line with SRCPOS.
>
> 2011/10/12 shenrfen <[email protected] <mailto:[email protected]>>
>
> All chi_node are added to entry_bb.
>
> We cannot get the exactly line number from source code position.
>
>
>
> *From:* Jian-Xin Lai [mailto:[email protected] <mailto:[email protected]>]
> *Sent:* Wednesday, October 12, 2011 3:06 PM
> *To:* shenrfen
> *Cc:* [email protected]
> <mailto:[email protected]>
> *Subject:* Re: [Open64-devel] Please help to review the patch for [Bug
> 879]: Missing line number of uninitialized variable warning
>
>
>
> I think using SRCPOS is better.
>
> 2011/10/11 shenrfen <[email protected] <mailto:[email protected]>>
>
> Hi, all.
>
> Could a gatekeeper help to review the patch for bug879.
>
> Please find the detail:
> https://bugs.open64.net/show_bug.cgi?id=879
>
> I would like to add a member "line" to Class "ST".
>
>
>
> + mUINT32 line; // The line num where
> define the sym in the source file.
>
> With this field we can get the line info which define symbol.
>
> Attached Please fine the whole patch. The patch has passed SL’s
> regression test.
>
> Thx very much.
>
>
>
> -----Original Message-----
> From: [email protected] <mailto:[email protected]>
> [mailto:[email protected] <mailto:[email protected]>]
> Sent: Tuesday, October 11, 2011 2:56 PM
> To: [email protected] <mailto:[email protected]>
> Subject: [Bug 879] New: Missing line number of uninitialized variable
> warning
>
>
>
> https://bugs.open64.net/show_bug.cgi?id=879
>
>
>
> Summary: Missing line number of uninitialized variable warning
>
> Product: Open64 Compiler
>
> Version: 4.2.4
>
> Platform: Itanium
>
> OS/Version: Linux
>
> Status: NEW
>
> Severity: normal
>
> Priority: P2
>
> Component: WOPT
>
> AssignedTo: [email protected] <mailto:[email protected]>
>
> ReportedBy: [email protected] <mailto:[email protected]>
>
>
>
>
>
> 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.
>
>
>
> --
>
> Configure bugmail: https://bugs.open64.net/userprefs.cgi?tab=email
>
> ------- You are receiving this mail because: -------
>
> You are the assignee for the bug.
>
> You reported the bug.
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2d-oct
> _______________________________________________
> Open64-devel mailing list
> [email protected]
> <mailto:[email protected]>
> https://lists.sourceforge.net/lists/listinfo/open64-devel
>
>
>
>
> --
> Regards,
> Lai Jian-Xin
>
>
>
>
> --
> Regards,
> Lai Jian-Xin
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel