C and C++


LANG.STRUCT.REGISTER : Register Keyword

Summary

A use of the register keyword, which is deprecated.

Properties

Class Name Register Keyword
Significance style
Mnemonic LANG.STRUCT.REGISTER
Categories
AUTOSARC++14 AUTOSARC++14:A1-1-1 All code shall conform to ISO/IEC 14882:2014 - Programming Language C++ and shall not use deprecated features.
  AUTOSARC++14:A7-1-4 The register keyword shall not be used.
MisraC++2023 MisraC++2023:4.1.2 Deprecated features should not be used
JSF++ JSF++:140 The register storage class specifier shall not be used.
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default, and require the unnormalized C ASTs for the project. To enable them, add the following WARNING_FILTER rule and RETAIN_UNNORMALIZED_C_AST specification to the project configuration file.
RETAIN_UNNORMALIZED_C_AST = Yes
WARNING_FILTER += allow class="Register Keyword"
Note that retaining the unnormalized ASTs will increase the disk space used to store the project representation, and may make the analysis take longer.

Example

void lang_struct_register(register int a) {  /* 'Register Keyword' warning issued here */
    register int x;                          /* 'Register Keyword' warning issued here */
}

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.