Path: utzoo!utgpu!water!watmath!clyde!att!pacbell!ames!haven!mimsy!tank!uxc!uxc.cso.uiuc.edu!m.cs.uiuc.edu!s.cs.uiuc.edu!carroll From: carroll@s.cs.uiuc.edu Newsgroups: comp.lang.c Subject: local extern : MS vs. the world Message-ID: <207600006@s.cs.uiuc.edu> Date: 25 Oct 88 17:20:00 GMT Lines: 15 Nf-ID: #N:s.cs.uiuc.edu:207600006:000:888 Nf-From: s.cs.uiuc.edu!carroll Oct 25 12:20:00 1988 Small note - MS C actually found a bug that a number of other compilers didn't. In porting code from UNIX to my AT, the compiler choked on code that compiled fine on UNIX. The problem was that it had declared extern long int mem_size inside several functions, but used it in a function in which it had not been declared. We had previously compiled this on Sun3.4, 4.3BSD on RT's, SysV on 3b2's and 3b20's, and a Sequent. Not one of these caught the error. Apparently they take 'extern' declarations to be global to the file, even if the declaration is local to a function. I agree with MS on this one - local 'extern' declarations *should* be local. Any comments? Alan M. Carroll "How many danger signs did you ignore? carroll@s.cs.uiuc.edu How many times had you heard it all before?" - AP&EW CS Grad / U of Ill @ Urbana ...{ucbvax,pur-ee,convex}!s.cs.uiuc.edu!carroll