delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2001/06/18/13:49:32

From: "Tim Van Holder" <tim DOT van DOT holder AT pandora DOT be>
To: "DJGPP-Workers" <djgpp-workers AT delorie DOT com>
Subject: Hmmph - how do you cast away const in our libc?
Date: Mon, 18 Jun 2001 19:16:49 +0200
Message-ID: <CAEGKOHJKAAFPKOCLHDIIEGNCEAA.tim.van.holder@pandora.be>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
Importance: Normal
Reply-To: djgpp-workers AT delorie DOT com

How the smeg do you cast away const with the current
compilation flags?
My unsetenv() calls putenv() to do the actual unsetting.
unsetenv() is supposed to take a const char*; putenv has
been changed in the new Posix spec to take a non-const
char*.  Obviously, this generated a warning - but so does
adding a cast.  Is there a way around this, or do I need
to pass a copy of the string to putenv()? This would,
admittedly, be more robust to changes in putenv(), but
also introduces a (slight) overhead.

- Raw text -


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