Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build warnings on osX #4

Open
mjerris opened this issue Dec 26, 2018 · 0 comments
Open

Fix build warnings on osX #4

mjerris opened this issue Dec 26, 2018 · 0 comments

Comments

@mjerris
Copy link
Contributor

mjerris commented Dec 26, 2018

/Users/mike/src/libks/src/ks_handle.c:112:53: warning: result of comparison of constant 65536 with expression of type 'uint16_t' (aka 'unsigned short') is
always true [-Wtautological-constant-out-of-range-compare]
for (uint16_t slot_index = start_index; slot_index < KS_HANDLE_MAX_SLOTS; slot_index++) {
~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
/Users/mike/src/libks/src/ks_handle.c:216:18: warning: result of comparison of constant 65536 with expression of type 'uint16_t' (aka 'unsigned short') is
always false [-Wtautological-constant-out-of-range-compare]
if (*slot_index >= KS_HANDLE_MAX_SLOTS) {
~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~
2 warnings generated.
/Users/mike/src/libks/src/ks_json.c:686:15: warning: implicit conversion from enumeration type 'const cJSON_TYPES' to different enumeration type 'KS_JSON_TYPES'
[-Wenum-conversion]
return item->type;
~~~~~~ ~~~~~~^~~~
1 warning generated.
/Users/mike/src/libks/src/ks_log.c:210:65: warning: format specifies type 'int' but the argument has type 'ks_size_t' (aka 'unsigned long') [-Wformat]
used += snprintf(buf + used - 1, bufSize - used, "[LF:%d] ", g_wakeup_stdout_fails);
~~ ^~~~~~~~~~~~~~~~~~~~~
%zu
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro
'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~~~~~~~~~
/Users/mike/src/libks/src/ks_log.c:214:65: warning: format specifies type 'int' but the argument has type 'ks_size_t' (aka 'unsigned long') [-Wformat]
used += snprintf(buf + used - 1, bufSize - used, "[LS:%d] ", g_wakeup_stdout_successes);
~~ ^~~~~~~~~~~~~~~~~~~~~~~~~
%zu
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/secure/_stdio.h:57:62: note: expanded from macro
'snprintf'
__builtin___snprintf_chk (str, len, 0, __darwin_obsz(str), VA_ARGS)
^~~~~~~~~~~
2 warnings generated.
/Users/mike/src/libks/src/ks_thread.c:144:9: warning: incompatible pointer to integer conversion returning 'pthread_t _Nonnull'
(aka 'struct _opaque_pthread_t *') from a function with result type 'ks_pid_t' (aka 'int') [-Wint-conversion]
return pthread_self();
^~~~~~~~~~~~~~
/Users/mike/src/libks/src/ks_thread.c:234:21: warning: address of function 'pthread_setname_np' will always evaluate to 'true' [-Wpointer-bool-conversion]
if (thread->tag && pthread_setname_np)
~~ ^~~~~~~~~~~~~~~~~~
/Users/mike/src/libks/src/ks_thread.c:234:21: note: prefix with the address-of operator to silence this warning
if (thread->tag && pthread_setname_np)
^
&
2 warnings generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant