delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/03/07/02:17:57

From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: What are these warning? How do I fix them?
Date: Thu, 06 Mar 1997 21:28:48 -0800
Organization: Alcyone Systems
Lines: 35
Message-ID: <331FA790.2C112DDC@alcyone.com>
References: <5fnmh9$ib3 AT news DOT interlog DOT com>
NNTP-Posting-Host: newton.alcyone.com
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Gautam N. Lad wrote:

> I get these warnings, in my program (which is a C++ programming).  Here's
> the
> errors.  I've the right include files, but what gives?
> 
> tb.cpp: In function `void ShowTitle()':
> tb.cpp:1286: warning: implicit declaration of function `int lseek(...)'
> tb.cpp:1296: warning: implicit declaration of function `int read(...)'
> tb.cpp:1331: warning: implicit declaration of function `int close(...)'

lseek, read, and close are non-ANSI, Unix-specific function calls which use
file descriptors rather than FILE pointers.

To get rid of the warnings, 

    #include <unistd.h>

> Now, what is wrong here?  Although my program works properly, I detest
> having
> 'warnings' in my compiles (who doesn't).

You'd be surprised how many people don't mind warnings, even when they pour
out like a fountain.  Hey, as long as it works. . . . but warnings will
often lead you towards problems that will come up much later on and will be
harder to find if you're already ignoring (or have turned off) the
warnings.

-- 
       Erik Max Francis, &tSftDotIotE / email:  max AT alcyone DOT com
                     Alcyone Systems /    web:  http://www.alcyone.com/max/
San Jose, California, United States /    icbm:  37 20 07 N  121 53 38 W
                                   \
              "I am become death, / destroyer of worlds."
                                 / J. Robert Oppenheimer (quoting legend)

- Raw text -


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