Keil Logo

Differences Between µVision and C

A number of differences exist between ANSI C and the language subset to support features in user- and signal functions.

  • µVision does not differentiate between uppercase and lowercase. The names of objects and control statements may be written in either uppercase or lowercase.
  • µVision has no preprocessor. Preprocessor directives like #define, #include, and #ifdef are not supported.
  • µVision does not support global declarations. Scalar variables must be declared within a function definition. You may define symbols with the DEFINE command and use them like you would use a global variable.
  • In µVision, variables may not be initialized when they are declared. Explicit assignment statements must be used to initialize variables.
  • µVision functions only support scalar variable types. Structures, arrays, and pointers are not allowed. This applies to the function return type as well as the function parameters.
  • µVision functions may only return scalar variable types. Pointers and structures may not be returned.
  • µVision functions cannot be called recursively. During function execution, µVision recognizes recursive calls and aborts function execution if one is detected.
  • µVision functions may only be invoked directly using the function name. Indirect function calls via pointers are not supported.
  • µVision supports only the ANSI style for function declarations with a parameter list. The old K&R format is not supported. For example, the following ANSI style function is acceptable.
func test (int pa1, int pa2)  {    /* ANSI type, correct */
  /* ...  */

The following K&R style function is not acceptable.

func test (pa1, pa2)                     /* Old K&R style is */
int pa1, pa2;                               /* not supported */
  /* ... */
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.