Why does my generated code declare functions using the static keyword in R2017b when the generated code used extern in R2016b?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
MathWorks Support Team
il 20 Feb 2019
Risposto: MathWorks Support Team
il 26 Mar 2019
In MATLAB R2016b, my generated code uses extern when declaring functions for my atomic subsystems.
In MATLAB R2017b, the generated code uses static when declaring the same functions.
I have not changed the models or configuration parameters between releases. My atomic subsystems have compact file packaging enabled.
What is the root cause of the discrepancy?
Risposta accettata
MathWorks Support Team
il 20 Feb 2019
This is expected behavior - in MATLAB R2017b, the functions were changed to be declared as 'static' (i.e. file scoped) rather than 'extern' if compact file packaging is enabled:
Since compact file packaging is enabled, you can disable the 'Preserve static keyword in function declarations' option in the 'Code Generation' > 'Code Style' pane of the configuration parameters to generate code with extern declarations rather than static declarations.
<<customerartifacts-mathworks-com-SalesForce-AMER-03465901-2019-02-12_10-25-43.png>>
With this option disabled, the generated code from MATLAB R2017b will use extern function declarations and will be consistent with the code generated by MATLAB R2016b.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Simulink Coder in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!