Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!dali.cs.montana.edu!caen!sol.ctr.columbia.edu!emory!hubcap!ncrcae!ncr-sd!se-sd!cns!dltaylor From: dltaylor@cns.SanDiego.NCR.COM (Dan Taylor) Newsgroups: comp.sys.amiga.programmer Subject: Re: Is this valid C? Message-ID: <936@cns.SanDiego.NCR.COM> Date: 6 May 91 21:40:26 GMT References: <1991May5.222328.16225@csis.dit.csiro.au> Organization: NCR Corp. SE-San Diego Lines: 25 In <1991May5.222328.16225@csis.dit.csiro.au> dave@csis.dit.csiro.au (David Campbell) writes: >Is this valid C? Doesn't look right to me. You have declared the struct (as extern) before you have defined it (the description just below). >extern struct thing t; >struct thing { > int n; > char *s; >}; Then you proceed to use a structure tag "t", in main(), that is either not properly defined, or declared, depending on what the complier does with the previous conflict. Where does the compiler choke? By the way, try running that through "lint". It isn't perfect, but I've found a few common typos, and more than a few definition/declaration errors using it. Dan Taylor