Borrar filtros
Borrar filtros

RTW : Why is errorStatus in Release 14 SP3 & R2006b is declared differently?

3 visualizaciones (últimos 30 días)
The errorStatus in R14 SP3 is declared as 'const' whereas from R2006b it is being declared as 'const volatile'. Why is it declared so? how can i avoid this change? please help...

Respuesta aceptada

Kaustubha Govind
Kaustubha Govind el 31 de Oct. de 2012
Not sure, but perhaps it is expected that there might be external hardware drivers that could update the errorStatus flag? I don't know if this can be avoided - it is best to contact MathWorks Tech Support for this question to get an authoritative answer.
  2 comentarios
venkat
venkat el 31 de Oct. de 2012
Got it. The volatile type specifier tells the compiler that some other thread can change the value unexpectedly and the compiler must not load the error flag into a register
To some extent this compromises the code optimisation, but whats more important is whether the compiler is referring the updated value.
Thank you KG & Mathworks Tech Support for your responses.
Kaustubha Govind
Kaustubha Govind el 2 de Nov. de 2012
venkat: Thanks for posting a more detailed explanation. :)

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre AUTOSAR Blockset en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by