The CODE_STATE Pragma

The CODE_STATE pragma overrides the compilation state of a file, at the function level. For example, if a file is compiled in thumb mode, but you want a function in that file to be compiled in 32-bit mode, you would add this pragma in the file. The compilation state for the function is changed to 16-bit mode (thumb) or 32-bit mode.

The syntax of the pragma is C is:

#pragma CODE_STATE ( function, {16|32} )

The syntax of the pragma in C++ is:

#pragma CODE_STATE ( code state)