From: "Tim Van Holder" To: "DJGPP-Workers" Subject: Hmmph - how do you cast away const in our libc? Date: Mon, 18 Jun 2001 19:16:49 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit 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.