Bugs item #1818227, was opened at 2007-10-22 16:07
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1818227&group_id=4664
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: C lexer/parser
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Hans-Bernhard Broeker (broeker)
Summary: line continuation causing global var to be seen as local var
Initial Comment:
Hi all,
The following code will trick the cscope to think that "int parm" is a local variable within a function called "defined" instead of a global variable; therefore, when you try to search for symbol "parm" under cscope "Find this global definition:", you won't be able to find it. Consider the code below.
#include <stdio.h>
#if defined(__FOO1__) \
|| defined(__FOO2__) /* <<- this line continuation causes cscope to seeing parm as local instead of global */
#define SOMETHING
#endif
int parm;
int main ()
{
parm = 2;
printf ("parm=%d\n", parm);
}
The cscope properly detects "int parm" in the code segment below.
#include <stdio.h>
#if defined(__FOO1__) || defined(__FOO2__)
#define SOMETHING
#endif
int parm;
int main ()
{
parm = 2;
printf ("parm=%d\n", parm);
}
Regards,
Adisorn.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=104664&aid=1818227&group_id=4664
|