Suppress warnings when using mexw32
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Akzeptierte Antwort
Walter Roberson
am 16 Nov. 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 Kommentare
Walter Roberson
am 16 Nov. 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.
Weitere Antworten (1)
Kaustubha Govind
am 16 Nov. 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')
Siehe auch
Kategorien
Mehr zu Call C from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!