Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uwm.edu!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!sirius.ucs.adelaide.edu.au!augean!chook.ua.oz!cagney From: cagney@chook.ua.oz (Andrew Cagney - aka Noid) Newsgroups: comp.os.minix Subject: ANSI c extern question Message-ID: <724@augean.OZ> Date: 9 Feb 90 04:44:32 GMT Sender: news@augean.OZ Reply-To: cagney@chook.ua.oz (Andrew Cagney - aka Noid) Organization: Comp Sci, Uni of Adelaide, Australia Lines: 16 Is the following valid ANSI C (when declaring 'global' objects)? int i[]; vs extern int i[]; int i[] = {1,2,3,4,5}; int i[] = {1,2,3,4,5}; The real question is: is int i[]; a `tentative definition' given that it fails to specify the size of the object it is defining? So either 1. int i[]; is not a vaild definition so treat it as a declaration. 2. int i[]; is missing the `extern' directive so it is a `tentative definition' *but* it fails to specify the object size and hence is in error. Confused, Andrew Cagney. BTW: GCC and unix compilers use choice 1, TCC follows choice two. see fs/table.c for an example of the code.