XC8 compiler: Same variable names across different C source files causes issues
That is perfectly normal under any compiler.
By default, if you declare variable X in modules A and B then these will be the same variable, as by default these will have extern linkage, unless otherwise told with static linkage.
You would see that if you declare the variables with initial value, i.e. int X = 3; in module A and int X = 4; in module B, then the compiler will complain that you can't initialize the same variable twice.