'mcc' ignoring "-w disable" option

11 ビュー (過去 30 日間)
Tom
Tom 2025 年 1 月 16 日
コメント済み: Tom 2025 年 1 月 17 日
I'm using a Makefile (on Linux) to call 'mcc' (R2017b) to compile multiple projects. I've added the "-w disable" option, and when 'make' prints out the command line, the option is there. But the console output still contains warning messages. Am I missing or not correctly understanding something?
In case it's important, the specific warning I really want to suppress is MATLAB:depfun:req:CorrespondingMCodeIsEmpty. There are 1000s of lines of console output for this warning type, but I know everything compiles and works fine. So I want to improve my odds of catching any other warnings that might show up. Trying to disable just that one warning wasn't working, so I tried to disable all warnings and discovered this problem.
Again, in case it's important, these warnings are being triggered by P-code files that are being brought in via a "-a" specification.
The full command line being issued by 'make' is like:
cd mcc/linux && /path/to/mcc -R -nodesktop -m -v -w disable -a /path/to/pcode -a /another/path/to/pcode /path/to/source.p
ETA: I have also tried entering the 'mcc' portion of this command line directly in the Matlab GUI (R2018a this time, with both "-w disable" and "-w off") and the warnings still appear. So again, it seems either 'mcc's "-w" option is broken or I'm missing/misinterpreting something.
All assistance appreciated!
  1 件のコメント
Tom
Tom 2025 年 1 月 17 日
Further info: if I enter
warning('off','MATLAB:depfun:req:CorrespondingMCodeIsEmpty')
At the Matlab GUI command line and then enter the 'mcc' command (without any "-w" option), the warning is suppressed as desired.
So maybe the issue is a combination of:
  1. "-w disable" applies to compile-time warnings, but maybe only those in the "Compiler" heirarchy? This would seem to be a defect in Matlab that it doesn't suppress all compile-time warnings.
  2. "-w off" applies only to runtime warnings, so turning it off doesn't suppress a (non-"Compiler") warning at compile time

サインインしてコメントする。

回答 (1 件)

Githin George
Githin George 2025 年 1 月 17 日
I would recommend using MATLAB’s inbuild “warning” command to see if the issue gets resolved as it is mentioned in the “mcc” documentation as well:
More specifically, use the “warning” command to turn “off” the warning for “MATLAB:depfun:req:CorrespondingMCodeIsEmpty” as shown below:
>> warning('off','MATLAB:depfun:req:CorrespondingMCodeIsEmpty’)
I hope this helps.
  1 件のコメント
Tom
Tom 2025 年 1 月 17 日
What you're suggesting might work if I were running 'mcc' from the Matlab GUI command line, but as noted I'm invoking 'mcc' from a Makefile. So I only have 'mcc' command-line arguments to work with.
I did try using "-w off" rather than "-w disable", but that didn't work either.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMATLAB Compiler についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by