delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/12/30/03:51:27

Date: Wed, 30 Dec 1998 10:51:27 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Stuart Hall <fprintf AT iname DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: -pedantic, -ansi --> not really recommended in GNU CC/RHIDE Help?
In-Reply-To: <36893f93.7126974@news>
Message-ID: <Pine.SUN.3.91.981230105025.21377K-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Tue, 29 Dec 1998, Stuart Hall wrote:

> What I wonder is, what are the useful flags to use for a newbie
> programmer?

The best combination of flags is "-Wall -O" (that's a capital o, not a
zero).  The reason for -O is that some sophisticated tests are only
performed by the compiler as part of optimizing the code, so you could
miss some warnings if you compile without -O.

-Wall catches a lot of dubious (aka: buggy) code.  If you want even
more diagnostics, add these switches to -Wall:

  -W 
  -Wbad-function-cast 
  -Wcast-qual 
  -Wmissing-declarations 
  -Wmissing-prototypes 
  -Wpointer-arith
  -Wshadow
  -Wstrict-prototypes
  -Wwrite-strings

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019