Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site harvard.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!draves From: draves@harvard.ARPA (Richard Draves) Newsgroups: net.lang.c Subject: storage classes in global declarations Message-ID: <330@harvard.ARPA> Date: Sat, 26-Jan-85 00:25:02 EST Article-I.D.: harvard.330 Posted: Sat Jan 26 00:25:02 1985 Date-Received: Mon, 28-Jan-85 06:38:49 EST Distribution: net Organization: Aiken Computation Laboratory, Harvard Lines: 32 Our 4.2bsd cc exhibits some remarkably strange behaviour when given duplicate declarations. For example: static int a; static int a; /* illegal */ static int f(); static int f(); /* legal */ extern int b; static int b; /* legal */ extern int g(); static int g(); /* illegal */ static int c; extern int c; /* legal */ static int h(); extern int h(); /* legal */ I can understand different behaviour for variables and functions, but the other situations I don't understand. Declaring a variable both extern and static is legal? But for functions it's illegal?? But it's legal when you switch the order??? Is this yet another bug in cc, or some strange feature of C? Rich -- "If I am conceited, it is the conceit of an amazing man who has never found any surpassing himself." Al-Mutanabbi