Suppress warnings when using mexw32
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I use a read_file.mexw32 to read data from a file into a struct. This struct consists out of several structs in several hierarchies.
When i execute the file I get a lot of same warnings which i want to suppress: Warning: containerSizeStruct not initialized in struct T_ENVIRONMENT Warning: containerSizeStruct not initialized in struct T_TEST_PULSE etc.
Can anyone help me how to solve this?
Matlab version 7.11.0.584 (R2010b), win32 Windows XP
0 comentarios
Respuesta aceptada
Walter Roberson
el 16 de Nov. de 2011
In my experience, those "warnings" are almost always errors that will result in incorrect code being generated, so the only real solution is to ensure that containerSizeStruct is defined.
3 comentarios
Walter Roberson
el 16 de Nov. de 2011
"The data retreived in the struct is oke." -- No, you simply have not noticed the errors yet.
The message you indicate corresponds to an absolute error in ANSI C (1989, 1999, and all Technical Corrigenda up through TC6 (2005) at least.)
There is a GCC extension that permits an moral equivalent under fairly limited conditions, but even that is expected to be coded quite differently.
But perhaps I am misunderstanding what the error message is saying.
Más respuestas (1)
Kaustubha Govind
el 16 de Nov. de 2011
It's not clear to me whether the warning is coming from MATLAB or the MEX-function. Assuming that MATLAB is throwing the warning, you need to first find the message ID of the warning. Use this command right after the warnings appear:
[warnmsg, msgid] = lastwarn;
msgid will contain the warning ID (say, TestEnv:InvalidInput).
You can then turn off this warning using:
warning('off', 'TestEnv:InvalidInput')
Ver también
Categorías
Más información sobre Call C from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!