clang audio_switch.c main.c -o audio_switch
audio_switch.c:215:81: warning: 'GetMacOSStatusErrorString' is deprecated: first deprecated in macOS 10.8
[-Wdeprecated-declarations]
printf("Failed setting mute state. Error: %d (%s)", status, GetMacOSStatusErrorString(status));
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h:807:1: note:
'GetMacOSStatusErrorString' has been explicitly marked deprecated here
GetMacOSStatusErrorString(OSStatus err) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_1...
^
audio_switch.c:222:91: warning: 'GetMacOSStatusErrorString' is deprecated: first deprecated in macOS 10.8
[-Wdeprecated-declarations]
printf("Failed setting mute state for input. Error: %d (%s)", status, GetMacOSStatusErrorStr...
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h:807:1: note:
'GetMacOSStatusErrorString' has been explicitly marked deprecated here
GetMacOSStatusErrorString(OSStatus err) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_1...
^
audio_switch.c:227:92: warning: 'GetMacOSStatusErrorString' is deprecated: first deprecated in macOS 10.8
[-Wdeprecated-declarations]
printf("Failed setting mute state for output. Error: %d (%s)", status, GetMacOSStatusErrorSt...
^
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Debugging.h:807:1: note:
'GetMacOSStatusErrorString' has been explicitly marked deprecated here
GetMacOSStatusErrorString(OSStatus err) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_4, __MAC_1...
^
audio_switch.c:210:16: warning: enumeration value 'kAudioTypeUnknown' not handled in switch [-Wswitch]
switch(typeRequested) {
^
audio_switch.c:210:16: note: add missing switch cases
switch(typeRequested) {
^
audio_switch.c:286:43: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers
[-Wincompatible-pointer-types-discards-qualifiers]
if (CFStringGetCString(deviceUID, deviceUID_string, maxSize, kCFStringEncodingUTF8)) {
^~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFString.h:333:57: note:
passing argument to parameter 'buffer' here
Boolean CFStringGetCString(CFStringRef theString, char *buffer, CFIndex bufferSize, CFStringEncoding encoding);
^
audio_switch.c:417:113: warning: incompatible integer to pointer conversion passing 'int' to parameter of type
'const void * _Nullable' [-Wint-conversion]
...&propertyAddress, sizeof(AudioClassDescription), kAudioDevicePropertyScopeInput, &dataSize);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardware.h:263:69: note:
passing argument to parameter 'inQualifierData' here
const void* __nullable inQualifierData,
^
audio_switch.c:601:21: warning: comparison between pointer and integer ('AudioDeviceID' (aka 'unsigned int') and
'void *') [-Wpointer-integer-compare]
if (newDeviceID != nil) {
~~~~~~~~~~~ ^ ~~~
audio_switch.c:612:21: warning: comparison between pointer and integer ('AudioDeviceID' (aka 'unsigned int') and
'void *') [-Wpointer-integer-compare]
if (newDeviceID != nil) {
~~~~~~~~~~~ ^ ~~~
audio_switch.c:623:21: warning: comparison between pointer and integer ('AudioDeviceID' (aka 'unsigned int') and
'void *') [-Wpointer-integer-compare]
if (newDeviceID != nil) {
~~~~~~~~~~~ ^ ~~~
audio_switch.c:703:12: warning: enumeration values 'kAudioTypeUnknown' and 'kAudioTypeAll' not handled in switch
[-Wswitch]
switch(typeRequested) {
^
audio_switch.c:703:12: note: add missing switch cases
switch(typeRequested) {
^
audio_switch.c:718:23: error: use of undeclared identifier 'kAudioObjectPropertyElementMain'; did you mean
'kAudioObjectPropertyElementName'?
.mElement = kAudioObjectPropertyElementMain,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
kAudioObjectPropertyElementName
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreAudio.framework/Headers/AudioHardwareBase.h:331:5: note:
'kAudioObjectPropertyElementName' declared here
kAudioObjectPropertyElementName = 'lchn',
^
10 warnings and 1 error generated.