<p>Somewhere I had got it in my head that global variables had static storage class by default. I guess I was wrong.</p>
<p><blockquote type="cite">On May 5, 2010 2:45 PM, "Dale Johannesen" <<a href="mailto:dalej@apple.com">dalej@apple.com</a>> wrote:<br><br><div style="word-wrap:break-word"><p><font color="#500050"><br>On May 5, 2010, at 2:32 PMPDT, Nathan Jeffords wrote:<br>
<br>>><br>>> Global definitions like "int x;" are t...</font></p><div>Technically yes; the original K&R C book had the one-definition rule in it. Early C compilers did not work this way, however, and by the time that book was published (1978) there was already a large body of code that assumed the "common" model (also Ritchie's preference, I believe). In practice most compilers still default to this model because a lot of widely used stuff will break if they don't, and the behavior is given in J.5.11 of C99 as a common extension.</div>
<div><br></div><div>Use -fno-common to turn it off.</div><div><br></div></div></blockquote></p>