Xref: utzoo comp.lang.c:38051 news.software.b:7408 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!axion!uzi-9mm.fulcrum.bt.co.uk!igb From: igb@fulcrum.bt.co.uk (Ian G Batten) Newsgroups: comp.lang.c,news.software.b Subject: Redeclaration of Variables extern/static Keywords: scope, ibm, c news Message-ID: <^R+_H3-@uzi-9mm.fulcrum.bt.co.uk> Date: 8 Apr 91 15:56:35 GMT Sender: news@fulcrum.bt.co.uk (News with an UZI) Organization: BT Fulcrum, Birmingham Lines: 19 C News, amongst other things, has declarations of ``extern int foo;'' in either a header or towards the top of a file, and later has ``static int foo;''. An example is found in libc/datetok.c or libc/getdate.y. This compiles happily with V.2, V.3, V.4, SunOS 4.0, gcc -traditional or gcc in ansi mode. In the last case it generates a warning about redeclaration. On an IBM RS/6000 (it wasn't my idea) in generates an identifier redeclared error and exits during compilation. Lint on an RS/6000 merely reports the redeclaration as a warning. This is great: a C compilers that objects to code lint merely warns about. Can anyone quote chapter and verse as to the legality of this? As I want to compile C news, can anyone suggest a workaround? We've had the RS/6000 for a few days now and kids, I'll now believe any story, however bad... ian