From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,17e99293e94a7e6f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-06 09:38:29 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Another ammunition Date: 03 Jan 2003 10:24:44 -0500 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1041608244 16515 128.183.235.92 (3 Jan 2003 15:37:24 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 3 Jan 2003 15:37:24 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:32625 Date: 2003-01-03T15:37:24+00:00 List-Id: "AG" writes: > > Jean-Pierre Rosen wrote: > > > -ansi -Wall -pedantic -Wtraditional -Wpointer-arith -Wshadow > > -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wcast-qual > > -Waggregate-return -Wmissing-declarations -Wnested-externs -Winline > > -Werror -W > > > Forces you to fix the simple bugs to even get your code to compile > > (leaving you to be more creative in creating tricky logic bugs). > > That's an interesting example. All those switches needed > to force you to "fix the simple bugs"? How many people > would you think would bother with all the switches? That's what coding standards are for. Nobody should use any compiler with just the default switches, at least not without a lot of thought first. Here's the relevant section from our coding standard: (2) Compilers shall be configured to enforce the ANSI standard. Table 1 gives the compiler switches required (3) All code should compile without warnings. However, it is sometimes impossible to eliminate warnings; such cases should be documented with comments in the code. TABLE 1. Required Compiler switch settings GNU C -Wall -Wstrict-prototypes -pedantic -ansi -Werror > Even more importantly, how do you know *you* haven't > missed one or two? Because I have read the manuals, and I have been using this set of switches for several years. Every time I find a bug that I think should have been caught by the compiler, I check the manual to see if there is a new switch for that. Of course, first I say "we should be using Ada" :). > Isn't it better to just have all of that built right into the > language which compiler is required to enforce? Yes. That is what Ada is for. But even with Ada, you have to read the compiler documentation and set the compiler switches correctly. -- -- Stephe