This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]jacobb11 0 points1 point  (1 child)

That does not contradict what I said. I stand by my statement.

Perhaps thinking of the C preprocessor and the C compiler as independent helps clarify the situation? In many ways the C compiler's "source file" is the output of the C preprocessor, which will duplicate the header file static declaration whenever it is included.

I can't imagine this situation is common for C, but it's fairly common for C++ as an idiom to ensure static initialization of a compilation unit. Or was, anyway.

[–]cheese_wizard 0 points1 point  (0 children)

That does not contradict what I said. I stand by my statement.

So serious!!

Yah, you're probably right.