This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

static == extern ?

extern data and static diffenece

since static is used for keeping the value after existing function, extern use the value in other module.

are they the same?

Parents
  • "In uVision, to watch a function's static local variable from outside the function, you have to give the fully-qualified name like '\\module\function\fred' instead of just 'fred'"

    Having just been trying to watch a 'static' local, I now remember that it's worse than that:

    Actually, you always have to give the fully-qualified name - whether or not the variable is currently in-scope.

    This is a pain, as it means that the pop-up display of the current value doesn't work, the variable doesn't appear in the 'locals' window, and you can't add it to a Watch window by right clicking. :-(

    PS

    The syntax is actually '\module\function\fred' - only a single backslash to start

Reply
  • "In uVision, to watch a function's static local variable from outside the function, you have to give the fully-qualified name like '\\module\function\fred' instead of just 'fred'"

    Having just been trying to watch a 'static' local, I now remember that it's worse than that:

    Actually, you always have to give the fully-qualified name - whether or not the variable is currently in-scope.

    This is a pain, as it means that the pop-up display of the current value doesn't work, the variable doesn't appear in the 'locals' window, and you can't add it to a Watch window by right clicking. :-(

    PS

    The syntax is actually '\module\function\fred' - only a single backslash to start

Children
No data