jakehilborn / displayplacer

macOS command line utility to configure multi-display resolutions and arrangements. Essentially XRandR for macOS.
MIT License
3.74k stars 134 forks source link

Implicit declaration of 'mach_error_string' #95

Open Andrew-Au opened 2 years ago

Andrew-Au commented 2 years ago

Version 036ecda1f7ebdb3a93d2dad09b6c82fb45aa0a54

Building by running 'make' on direct checkout from master. Mac OX 10.5 using XCode 11.7

displayplacer % make cc -I. -o displayplacer displayplacer.c -framework IOKit -framework ApplicationServices -Wno-deprecated-declarations -Wall -Wempty-body -Wempty-init-stmt -Wignored-qualifiers -Winitializer-overrides -Wmissing-field-initializers -Wmissing-method-return-type -Wnull-pointer-arithmetic -Woverride-init -Wredundant-move -Wsemicolon-before-method-body -Wshift-negative-value -Wstring-compare -Wtype-limits -Wuninitialized -Wunused-parameter -Wbitfield-enum-conversion -Wbool-conversion -Wconstant-conversion -Wenum-conversion -Wimplicit-float-conversion -Wimplicit-int-conversion -Wint-conversion -Wliteral-conversion -Wnon-literal-null-conversion -Wnull-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wstring-conversion -Wshadow-field -Wshadow-field-in-constructor -Wshadow-uncaptured-local -Wformat -Wlogical-not-parentheses -Wnull-dereference displayplacer.c:493:83: warning: implicit declaration of function 'mach_error_string' is invalid in C99 [-Wimplicit-function-declaration] fprintf(stderr, "Error rotating screen %s: %s, code: 0x%x\n", screenUUID, mach_error... ^ displayplacer.c:493:83: warning: format specifies type 'char *' but the argument has type 'int' [-Wformat] ..."Error rotating screen %s: %s, code: 0x%x\n", screenUUID, mach_error_string(retVal), retVal); ~~ ^~~~~~~~~ %d 2 warnings generated.

mach/mach_error.h not included?

jakehilborn commented 2 years ago

I don't get any errors on my Intel mac running 11.2.3. I see it's just a warning, does it still compile and work though? But yeah, probably just need to include some header.

Matsuo3rd commented 2 years ago

Shall be solved with https://github.com/jakehilborn/displayplacer/pull/99

jakehilborn commented 1 year ago

@Matsuo3rd @Andrew-Au This issue should be fixed in release v.1.3.0. I was never able to reproduce it myself so I'm hoping @Matsuo3rd's bugfix works.

Could you try it out and let me know if it works?