Source: https://mokxi.com/errors/invalid-conversion-from-const-char
Updated: 2026-11-16

Home / Errors
Arduino build error

# error: invalid conversion from 'const char*' to 'char*' [-fpermissive]

A const char* points at text that must not change. A char* promises that the code may change it. C++ will not let you drop the promise.

Try the fixed sketch in Mokxi See the causes

- Build error
- 2 common causes
- Seen 487 times in failed builds on Mokxi in the 30 days to November 16, 2026.

The message

## What the Arduino IDE prints

Output window

Make the receiving side const, or copy the text into a buffer you own.

Mokxi's compiler, clang, words it as cannot initialize a variable of type char * with a value of type const char *.

Causes

## The 2 usual causes with the fix

### 1A const pointer is stored in a plain one

Declare the new pointer const as well, if you only read the text.

Broken

Fixed

Try this fix in Mokxi

### 2A const pointer is passed to a function that may change it

If the function only reads the text, make its parameter const char*. If it changes the text, give it a buffer of your own.

Broken

Fixed

Mokxi’s build tab says: shout is called with values it does not take.

Try this fix in Mokxi

FAQ

## Questions and answers

### What does const char* mean?

A pointer to characters that the code promises not to change. String literals such as "hello" have this type.

### Can I just cast the const away?

You can, but changing text that lives in read-only memory crashes or does nothing. Copy it into a char array first.

### Why is this an error in Arduino and a warning elsewhere?

The Arduino compiler runs with strict C++ rules for pointer conversions. The -fpermissive flag in the message is the switch that would relax it, and the fix is to make the types match.

Next

## More errors and the longer guide

- error: cannot convert 'String' to 'const char*'
- error: no matching function for call to 'digitalWrite(int)'

Every Arduino compile error All Arduino errors
