Temporarily disable -Wnonnull around an opus_decode() call in test_opus_decode.c
One of the opus_decode() calls in test_opus_decode.c passes 0 as the fourth argument. But that argument is marked as nonnull. So if we compile opus using an alternative build system that enables both -Werror and -Wnonnull, the compilation will fail.
Here is an example of the compilation error in the Chromium build system on Mac:
wtc-macpro:src wtc$ ninja -C out/Default test_opus_decode ninja: Entering directory `out/Default' [1/2] CC obj/third_party/opus/src/tests/test_opus_decode.test_opus_decode.o FAILED: ../../third_party/llvm-build/Release+Asserts/bin/clang -MMD -MF obj/third_party/opus/src/tests/test_opus_decode.test_opus_decode.o.d -DCHROMIUM_BUILD -DV8_DEPRECATION_WARNINGS -DCLD_VERSION=2 -DENABLE_NOTIFICATIONS -DENABLE_PEPPER_CDMS -DENABLE_PLUGINS=1 -DENABLE_PRINTING=1 -DENABLE_BASIC_PRINTING=1 -DENABLE_PRINT_PREVIEW=1 -DENABLE_SPELLCHECK=1 -DUSE_OPENSSL=1 -DNO_TCMALLOC -DDISABLE_NACL -DENABLE_EXTENSIONS=1 -DENABLE_CONFIGURATION_POLICY -DENABLE_TASK_MANAGER=1 -DENABLE_THEMES=1 -DENABLE_CAPTIVE_PORTAL_DETECTION=1 -DENABLE_SESSION_SERVICE=1 -DENABLE_PLUGIN_INSTALLATION=1 -DENABLE_APP_LIST=1 -DENABLE_SETTINGS_APP=1 -DENABLE_SUPERVISED_USERS=1 -DENABLE_SERVICE_DISCOVERY=1 -DENABLE_AUTOFILL_DIALOG=1 -DENABLE_WIFI_BOOTSTRAPPING=1 -DENABLE_REMOTING=1 -DENABLE_GOOGLE_NOW=1 -DENABLE_ONE_CLICK_SIGNIN -DENABLE_HIDPI=1 -DV8_USE_EXTERNAL_STARTUP_DATA -DCR_CLANG_REVISION=223108 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -I../.. -Igen -I../../third_party/opus/src/celt -I../../third_party/opus/src/silk -I../../third_party/opus/src/include -fno-strict-aliasing -fstack-protector-all -arch x86_64 -fcolor-diagnostics -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wnewline-eof -Wno-c++11-narrowing -Wno-char-subscripts -Wno-covered-switch-default -Wno-deprecated-register -Wno-unneeded-internal-declaration -Wno-reserved-user-defined-literal -Wno-inconsistent-missing-override -fvisibility=hidden -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk -mmacosx-version-min=10.6 -Xclang -load -Xclang ../../third_party/llvm-build/Release+Asserts/lib/libFindBadConstructs.dylib -Xclang -add-plugin -Xclang find-bad-constructs -Wheader-hygiene -Wstring-conversion -O0 -g2 -Wno-absolute-value -std=c99 -c ../../third_party/opus/src/tests/test_opus_decode.c -o obj/third_party/opus/src/tests/test_opus_decode.test_opus_decode.o ../../third_party/opus/src/tests/test_opus_decode.c:138:64: error: null passed to a callee that requires a non-null argument [-Werror,-Wnonnull] out_samples = opus_decode(dec[t], packet, 0, 0, 0, fec); ~ ^ 1 error generated. ninja: build stopped: subcommand failed.
One way to fix this is to use a GCC pragma to ignore -Wnonnull for that opus_decode() call.