delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/06/14:26:47

Date: Mon, 6 Sep 1999 19:09:19 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Manni Heumann <manfred DOT heumann AT uni-bielefeld DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: Annoying: const char * in Allegro
In-Reply-To: <37d38d41.0@news.uni-bielefeld.de>
Message-ID: <Pine.SUN.3.91.990906190544.12553A-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 6 Sep 1999, Manni Heumann wrote:

> The C library was also written in C. Nevertheless functions like printf take a 
> const char* as their first argument.

The library sources sometimes need to go to great lengths to do this, 
because the compiler doesn't like it when you take a const char * and 
pass it to a function that accepts a char *.  If a library function needs 
to call another library function, it might be a royal PITA to struggle 
with these problems.  Download djlsr202.zip and search for "unconst" to 
see what I mean.

This is what Shawn meant when he said that const tends to propagate 
through the entire source.

- Raw text -


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