delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2006/05/09/12:31:56

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Martin Ambuhl <mambuhl AT earthlink DOT net>
User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
Subject: Re: incompatible implicit declaration of built-in function...
References: <446093bc$0$12932$91cee783 AT newsreader02 DOT highway DOT telekom DOT at>
In-Reply-To: <446093bc$0$12932$91cee783@newsreader02.highway.telekom.at>
Lines: 26
Message-ID: <Of38g.1981$u4.1578@newsread1.news.pas.earthlink.net>
Date: Tue, 09 May 2006 16:16:46 GMT
NNTP-Posting-Host: 4.236.102.41
X-Complaints-To: abuse AT earthlink DOT net
X-Trace: newsread1.news.pas.earthlink.net 1147191406 4.236.102.41 (Tue, 09 May 2006 09:16:46 PDT)
NNTP-Posting-Date: Tue, 09 May 2006 09:16:46 PDT
Organization: EarthLink Inc. -- http://www.EarthLink.net
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Florian Xaver wrote:
> Hi!
> 
> example:
> 
> gcc -O3 -funroll-loops -Iinclude -c src/xlib/conlib.c -o obj/xlib/conlib.o
> src/xlib/conlib.c: In function 'ClearConsole':
> src/xlib/conlib.c:103: warning: incompatible implicit declaration of 
> built-in fu
> nction 'memset'

In <string.h>
      #include <string.h>
you will find a declaration
      void *memset(void *buffer, int ch, size_t num);

Note that memset returns a pointer to void.  But your code does not have 
a declaration of memset before use (am I a mindreader, or what?).  That 
means that it has an implicit declaration (before the current standard) 
with a return type of int.  [In the current standard, use without 
declaration is an error.]
Obviously, an int is not a pointer-to-void.
Fix this by #includeding <string.h>

Similar comments apply to your other errors.
[..]

- Raw text -


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