I always forget to add the ‘static’ prefix to my variabeles and functions, and so the GCC marks them as extern. Is it possible to change this behaviour so that it marks everything static by default. And is there a performance difference between the two types at runtime, or is it more a formality?
Share
Not to my knowledge.
Yes,
gccis able to perform further optimizations when objects or functions arestaticspecified. For example,gcc(even in-O0) will inline astaticspecified function that is called only once.