comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephen.A.Leake@nasa.gov>
Subject: Re: Another ammunition
Date: 03 Jan 2003 10:24:44 -0500
Date: 2003-01-03T15:37:24+00:00	[thread overview]
Message-ID: <ufzsa9ryb.fsf@nasa.gov> (raw)
In-Reply-To: hVyQ9.4454$F63.96878@news.xtra.co.nz

"AG" <ang@xtra.co.nz> writes:

> > Jean-Pierre Rosen <rosen@adalog.fr> 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



  parent reply	other threads:[~2003-01-03 15:24 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-31 10:23 Another ammunition Jean-Pierre Rosen
2002-12-31 11:43 ` Eric G. Miller
2002-12-31 12:57   ` Jean-Pierre Rosen
2002-12-31 16:23     ` Alexander Schreiber
2003-01-02  6:55       ` AG
2003-01-01 16:58         ` Alexander Schreiber
2003-01-07 12:54           ` Peter Hermann
2003-01-07 13:21           ` Richard Riehle
2003-01-11 18:29             ` Alexander Schreiber
2003-01-13  2:11               ` u.r. faust
2003-01-12 12:44                 ` Larry Kilgallen
2003-01-14  1:24                   ` Georg Bauhaus
2003-01-03  9:50         ` Jean-Pierre Rosen
2003-01-03 15:24         ` Stephen Leake [this message]
2002-12-31 16:40     ` Warren W. Gay VE3WWG
2003-01-04 20:17       ` David Thompson
2003-01-06 17:39         ` Warren W. Gay VE3WWG
2003-01-06 20:50           ` Stephen Leake
2003-01-06 22:16             ` Warren W. Gay VE3WWG
2003-01-07 18:37               ` Stephen Leake
2003-01-07 21:55                 ` Warren W. Gay VE3WWG
2003-01-01  9:05 ` Michael Erdmann
2003-01-07 13:03   ` Peter Hermann
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox