This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/33309] gcc.c:6236: error: passing argument 1 of 'xputenv' discards qualifiers from pointer target type
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Sep 2007 06:17:09 -0000
- Subject: [Bug bootstrap/33309] gcc.c:6236: error: passing argument 1 of 'xputenv' discards qualifiers from pointer target type
- References: <bug-33309-276@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from ghazi at gcc dot gnu dot org 2007-09-05 06:17 -------
(In reply to comment #1)
> I think I'll let Kaveh fix this one...
To what exactly do I owe this honor? :-)
AFAICT, this is a -Wwrite-strings error caused by a patch by FX:
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg02280.html
A quick fix might be to do ASTRDUP on the INIT_ENVIRONMENT string. It's okay
to use stack space for putenv strings here because we're in main(). However I
seem to recall a problem with alloca passed as a function argument in some
ancient version of gcc. So it'll need an intermediate tmp variable, or use
xstrdup to avoid alloca.
Another option would be to constify xputenv and use CONST_CAST on the argument
passed to putenv.
A third option would be to constify xputenv and fixinclude putenv on those
platforms where it isn't const.
--
ghazi at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33309