delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/09/19/08:00:02.1

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: qsort warning
Date: 19 Sep 2002 11:59:57 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 18
Message-ID: <amce7t$phh$1@nets3.rz.RWTH-Aachen.DE>
References: <Pine DOT LNX DOT 4 DOT 02 DOT 10209190604150 DOT 5107-100000 AT myp60 DOT mysystem DOT org>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 1032436797 26161 137.226.32.75 (19 Sep 2002 11:59:57 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 19 Sep 2002 11:59:57 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

shmartonak AT ticnet DOT com wrote:

> Can someone tell me what the following warning means?

> teepdir.c:284: warning: passing arg 4 of `qsort' from incompatible pointer
> type

> int qsizesort( void *kptr1, void *kptr2)
                ^^^^^^^^^^^^^^^^^^^^^^^^^

Both arguments of a qsort comparison functions must be "const void *".
The missing "const" is what makes the function pointer incompatible,
and thus generates the warning.  Re-check the documentation or your
ANSI C textbook.

-- 
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.

- Raw text -


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