Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] (file-) static variables

I can add isStatic() to the IVariable interface.  (I've already put it in
ICPPMember for my own use)
The 2nd item is a bug, I raised bug 85824 in bugzilla.  That shouldn't be
ambiguous, the first globalVar is a declaration, the second the definition,
they refer to the same variable.

If you find other bugs, or additional things that might need to be added to
the interfaces, its always good to raise a bug in bugzilla.

-Andrew


"Schorn, Markus" <Markus.Schorn@xxxxxxxxxxxxx> wrote on 02/18/2005 08:37:20
AM:

> Hi Andrew,
>
> * Question:
>   I need to distinguish between a file-static and a global variable,
>   as the scope of refactoring will be totally differnet:
>   // ----------------------------------------------------------------
>      static int xx;  // refactoring is limited to a single file
>      int global;     // refactoring needs to consider a lot of files.
>   // ----------------------------------------------------------------
>
>   How can I distinguish the two cases assuming I have got a binding
>   of type IVariable?
>
> * Shortcoming:
>   Given the code
>   // ----------------------------------------------------------
>      extern int globalVar;    // in file.h, included by file.cpp
>      int globalVar;           // in file.cpp
>
>      int foo() {
>         globalVar= 1;
>      }
>   // ----------------------------------------------------------
>
>   when resolving the binding for the reference to globalVar, I get an
>   DOMException, cause the binding is ambigous. Which is sort of true,
>   but still I need to look at one of the bindings.
>
>   Do you want me to create bugzillas for things like that?
>
> Markus.
>
>
>
>
>
>
>



Back to the top