Special support for embedded systems
This section briefly describes the extensions provided by the compiler to support specific features of RISC-V.
Extended keywords
The compiler provides a set of keywords that can be used for configuring how the code is generated. For example, there are keywords for controlling how to access and store data objects, as well as for controlling how a function should work internally and how it should be called/returned.
By default, language extensions are enabled in the IDE.
The compiler command line option -e makes the extended keywords available, and reserves them so that they cannot be used as variable names. See -e for additional information.
For more information, see Extended keywords. See also Data storage and Functions.
Pragma directives
The pragma directives control the behavior of the compiler, for example how it allocates memory, whether it allows extended keywords, and whether it issues warning messages.
The pragma directives are always enabled in the compiler. They are consistent with standard C, and are useful when you want to make sure that the source code is portable.
For more information about the pragma directives, see Pragma directives.
Predefined symbols
With the predefined preprocessor symbols, you can inspect your compile-time environment, for example time of compilation or the build number of the compiler.
For more information about the predefined symbols, see The preprocessor.
Accessing low-level features
For hardware-related parts of your application, accessing low-level features is essential. The compiler supports several ways of doing this: intrinsic functions, mixing C and assembler modules, and inline assembler. For information about the different methods, see Mixing C and assembler.