on-internet
← Community

variable access separation in c

Stack Overflow ·

context I am trying to figure out - how to achieve per-variable level of access control in c23. just by means of c itself it is unachievable as far as I know, therefore I would like to know if it is possible with other tools? demonstration assume there are three files: one.c int v1; void one() { v1 = 1; return 0; } two.c int v2; extern int v1; void two(void) { v1 = 2; return 0; } three.c int v3; extern int v1; extern int v2; void three(void) { v1 = 3; v2 = 3; return 0; } by default compiler would bundle them in single .o file, where v1,v2 and v3 would be marked as global. i could use --localiz

Comments

Sign in or sign up to comment and upvote.

No comments yet.