Why does .map file have _variable names and not just variable names?

Status
Not open for further replies.

jani12

Advanced Member level 4
Joined
Oct 30, 2014
Messages
108
Helped
0
Reputation
0
Reaction score
1
Trophy points
1,298
Activity points
2,536
In embedded software, why does the .map file have _variable names and not just variable names? A particular variable name in code doesn't start with underscore. Then, why does this variable start with an underscore in .map file?
 

Variable names that start with an underscore are valid variable names. But user variables do not, by convention, begin with an underscore. Variable names that begin with a single underscore are produced by the compiler (I am not sure who looks at them). There are system variables that begin with two underscores. For the user, it has no significance.
 
Reactions: jani12

    jani12

    Points: 2
    Helpful Answer Positive Rating
I think the compiler adds an underscore to all user-specified symbols to make sure that they never can clash with "internal" symbols used by the compiler.
The compiler can safely use any symbol that doesn't begin with an underscore.
 
Reactions: jani12

    jani12

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…