Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!newstop!exodus!margot.Eng.Sun.COM!donm From: donm@margot.Eng.Sun.COM (Don Miller) Newsgroups: comp.software-eng Subject: Re: Automated tools for verifying C style compliance? Summary: enforcement is cultural Keywords: style tools Message-ID: <3086@exodus.Eng.Sun.COM> Date: 19 Nov 90 19:19:28 GMT References: <4990@tekfdi.FDI.TEK.COM> <9544@orca.wv.tek.com> Sender: news@exodus.Eng.Sun.COM Organization: Sun Microsystems, Mt. View, Ca. Lines: 35 The response to the original poster's request for an automated style compliance verification tool reinforces my belief that this is another culturally dependent software development technique. To "enforce" anything but a quantifiable, documented, agreed upon standard with "permission" to evolve is, in my experience, fruitless. Even if the above qualifiers apply to an organization's proposed coding standard, the beneficial impact will, to a great extent, depend on the cultural receptivity to such a "constraint". Beyond the theory, I also have a practical contribution to the original post. If you indeed have a "pretty printer" that can output code in the desired standard format, you have your automated style verifier. Just run the code in question through the pretty printer and compare the resulting code with the original. As long as the "pretty printer" isn't doing other non-standard related modifications, the deviation from the standard will be the result. In UNIX land (SunOS of course :-): indent [options] source_file.c ; diff source_file.c source_file.c.BAK ; {mv source_file.c.BAK source_file.c} where [options] reflect the standard programming style, to the greatest extent possible. The mv is necessary since indent replaces the original source file with the "standardized" equivalent. Not a perfect solution, but relatively cheap. Previous comments referencing the questionable value of maintaining tools which must do parsing independent of the compiler apply. -- Don Miller | #include Software Quality Engineering | #define flame_retardent \ Sun Microsystems, Inc. | "I know you are but what am I?" donm@eng.sun.com |