extern
keyword in function declarationsSpecify whether to include the extern
keyword
in function declarations in the generated code.
The extern
keyword is optional for functions
with external linkage. It is considered good programming practice
to include the extern
keyword in function declarations
for code readability.
Category: Code Generation > Code Style
Default: on
Include the extern
keyword in function declarations in the generated code.
For example, the generated code for the model rtwdemo_hyperlinks
contains the following function declarations in
rtwdemo_hyperlinks.h
:
/* Model entry point functions */ extern void rtwdemo_hyperlinks_initialize(void); extern void rtwdemo_hyperlinks_step(void);
The extern
keyword explicitly indicates that
the function has external linkage. The function definitions in this
example are in the generated file rtwdemo_hyperlinks.c
.
Remove the extern
keyword from function declarations
in the generated code.
Parameter: PreserveExternInFcnDecls |
Type: character vector |
Value: 'on' | 'off' |
Default: 'on' |
Application | Setting |
---|---|
Debugging | No impact |
Traceability | No impact |
Efficiency | No impact |
Safety precaution | No impact |