delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/08/17:05:29

From: djcarterjr AT aol DOT com (DJCarterJr)
Newsgroups: comp.os.msdos.djgpp
Subject: Newbie help request: -wall and prototyping
Lines: 48
NNTP-Posting-Host: ladder05.news.aol.com
X-Admin: news AT aol DOT com
Date: 08 Jul 1999 20:25:05 GMT
Organization: AOL http://www.aol.com
Message-ID: <19990708162505.06504.00008761@ng-fo1.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

C and DJGPP gurus,

     I recently downloaded the djgpp compiler and the tutorial from Coronado
enterprises, in an attempt to learn how to program in C.  I have patiently
worked through all the examples, compiling and running all the programs with no
trouble until I got to Chapter 5, which discusses prototyping.  I think I
understand the basic Idea of prototyping (declaring functions ahead of time to
check return values the actual functions return?), but I am having trouble
getting gcc to check every program I write for prototyping.  (This is
recommended in the tutorial, and I see It's value.)  While scanning through the
mail archives at www.delorie.com/djgpp I found many people with the same
question.  The answer?  Use the -wall switch to enable most of the prototyping
checks when compiled.  I played around with this for a while, and discovered
that I could not compile a prog with this, but coule recompile(?) a program
with it.  For instance, I have the uncompiled source to a program, I will call
it myprog.c.  I type:

     gcc -o -wall myprog.exe myprog.c

on the command line in DOS and I get the error message:

     gcc.exe: myprog.exe: No such file or directory (ENOENT)

but if I compile with the command:

     gcc -o myprog.exe myprog.c

I get no error messages.  I can then recompile with the -wall switch (in my
first example) and get some error messages, but apparently it compiles the
program.

My questions are:

1.     Am I using the -wall switch correctly?  I really don't know DOS all that
well, and could be screwing up there.

2.     Can I configure something to use -wall automatically, without me having
to type it in every time I want to use it?

3.     Do I have the Idea behind protyping correct?  I am sure that I am close,
but not exactly right.


Thanks in Advance,
Carter
(Please e-mail reply, in addition to posting.  I will check both frequently.)


- Raw text -


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