error: invalid conversion from ‘const char*’ to ‘char*’ [-fpermissive]

Nick Leli nicholasleli@gmail.com
Tue Jan 3 23:09:00 GMT 2017


Hello,

I am new to compiling gcc and have been running into an error with
6.3.0.  Here's the scenario:

1. I am performing this on a Vagrant Ubuntu 16.04 machine
2. I have walked through the compilation steps here (installed
binutils 2.27, all pre-requisites) and am receiving the error when I
attempt to do `make all-gcc`
http://wiki.osdev.org/GCC_Cross-Compiler#The_Build
3. This progressed along, until finally returning the error below.

Can anyone offer any guidance on the issue?  Is this a bug in 6.3.0?

**Configure script:**
sudo ../gcc-6.3.0/configure --target=x86_64-darwin
--prefix="/home/ubuntu/opt/cross" --disable-nls --enable-languages=c
--without-headers --disable-multilib

**Full Error**
g++ -fno-PIE -c   -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE
-fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall
-Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings   -DHAVE_CONFIG_H -I. -I.
-I../../gcc-6.3.0/gcc -I../../gcc-6.3.0/gcc/.
-I../../gcc-6.3.0/gcc/../include
-I../../gcc-6.3.0/gcc/../libcpp/include
-I/home/ubuntu/src/build-gcc/./gmp -I/home/ubuntu/src/gcc-6.3.0/gmp
-I/home/ubuntu/src/build-gcc/./mpfr -I/home/ubuntu/src/gcc-6.3.0/mpfr
-I/home/ubuntu/src/gcc-6.3.0/mpc/src
-I../../gcc-6.3.0/gcc/../libdecnumber
-I../../gcc-6.3.0/gcc/../libdecnumber/dpd -I../libdecnumber
-I../../gcc-6.3.0/gcc/../libbacktrace
-I/home/ubuntu/src/build-gcc/./isl/include
-I/home/ubuntu/src/gcc-6.3.0/isl/include  -o darwin-driver.o -MT
darwin-driver.o -MMD -MP -MF ./.deps/darwin-driver.TPo
../../gcc-6.3.0/gcc/config/darwin-driver.c
../../gcc-6.3.0/gcc/config/darwin-driver.c: In function ‘void
darwin_driver_init(unsigned int*, cl_decoded_option**)’:
../../gcc-6.3.0/gcc/config/darwin-driver.c:302:34: error: invalid
conversion from ‘const char*’ to ‘char*’ [-fpermissive]
       char *first_period = strchr(vers_string, '.');
                                  ^
../../gcc-6.3.0/gcc/config/t-darwin:35: recipe for target
'darwin-driver.o' failed
make[1]: *** [darwin-driver.o] Error 1
make[1]: Leaving directory '/home/ubuntu/src/build-gcc/gcc'
Makefile:4124: recipe for target 'all-gcc' failed
make: *** [all-gcc] Error 2



More information about the Gcc-help mailing list