'mcc' ignoring "-w disable" option

34 views (last 30 days)
Tom
Tom on 16 Jan 2025 at 14:24
Commented: Tom on 17 Jan 2025 at 11:34
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 Comment
Tom
Tom on 17 Jan 2025 at 11:34
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

Sign in to comment.

Answers (1)

Githin George
Githin George on 17 Jan 2025 at 4:30
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 Comment
Tom
Tom on 17 Jan 2025 at 11:13
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.

Sign in to comment.

Categories

Find more on MATLAB Compiler in Help Center and File Exchange

Products


Release

R2017b

Community Treasure Hunt

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

Start Hunting!