Source: https://mokxi.com/errors/jump-to-case-label
Updated: 2026-11-16

Home / Errors
Arduino build error

# error: jump to case label [-fpermissive]

All cases of a switch share one block. A variable made inside one case would exist, unset, when another case runs. C++ refuses that.

Try the fixed sketch in Mokxi See the causes

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

The message

## What the Arduino IDE prints

Output window

Put the case in its own curly brackets, or make the variable before the switch.

Mokxi's compiler, clang, words it as cannot jump from switch statement to this case label, with a note about the variable.

Causes

## The 2 usual causes with the fix

### 1A variable is declared inside a case

Wrap the case body in curly brackets so the variable lives only there.

Broken

Fixed

Mokxi’s build tab says: A case above declares a variable, and the switch would jump past it

Try this fix in Mokxi

### 2The variable is only needed by one case but made first

Make the variable before the switch when several cases use it.

Broken

Fixed

Mokxi’s build tab says: A case above declares a variable, and the switch would jump past it

Try this fix in Mokxi

FAQ

## Questions and answers

### Why can I declare a variable in an if but not in a case?

An if body is its own block. The cases of a switch are labels inside one block, so a jump can skip a declaration.

### Is a variable without a value also an error?

No. Only a variable that is set up with a value or an object trips this. int level; alone compiles.

### Should I wrap every case in brackets?

Only the ones that declare variables. Brackets on all of them are harmless and make the code uniform.

Next

## More errors and the longer guide

- error: expected unqualified-id before 'if'
- error: expected ';' before '}' token

Every Arduino compile error All Arduino errors
