Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

[clang] Fix compiler warnings #206

Merged
merged 1 commit into from
Sep 23, 2016
Merged

Conversation

jprestwo
Copy link
Contributor

Fix the number of clang compiler errors which are all of the same type:

passing 'int32_t *' (aka 'int *') to parameter
of type 'uint32_t *' (aka 'unsigned int *') converts between pointers to
integer types with different sign [-Wpointer-sign]

Signed-off-by: Sakari Poussa [email protected]
Signed-off-by: James Prestwood [email protected]

@jprestwo
Copy link
Contributor Author

@poussa, This was your change, but I updated/rebased it. Could you check if it fixes the warnings on your Mac? If not we will have to go another route but the way I did it (adding get_int32 API) was preferred so we could keep an invalid callback ID as -1 instead of 0.

@grgustaf
Copy link
Contributor

LGTM, @poussa please merge if it works for you.

@jprestwo
Copy link
Contributor Author

We should also probably add some compiler flags to the linux build in attempt to match the OSX build.

@poussa
Copy link
Contributor

poussa commented Sep 23, 2016

Now we get another warning:

src/zjs_event.c:236:56: warning: passing 'char [sz]' to parameter of type 'const jerry_char_t *' (aka 'const unsigned char *') converts between pointers to
      integer types with different sign [-Wpointer-sign]
    jerry_value_t event_name_val = jerry_create_string(event);
                                                       ^~~~~
/Users/spoussa/src/iot/zephyr.js/deps/jerryscript/jerry-core/jerry-api.h:251:56: note: passing argument to parameter here
jerry_value_t jerry_create_string (const jerry_char_t *);                                                 ^

Fix the number of clang compiler errors which are all of the same type:

passing 'int32_t *' (aka 'int *') to parameter
      of type 'uint32_t *' (aka 'unsigned int *') converts between pointers to
      integer types with different sign [-Wpointer-sign]

Signed-off-by: Sakari Poussa <[email protected]>
Signed-off-by: James Prestwood <[email protected]>
@jprestwo
Copy link
Contributor Author

@poussa, the latest push has that case fixed as well as many others in zjs_util.c. I also added -Wpointer-sign to the flags for the linux build to catch these in the future, we should try and add other flags to the linux build that result in errors on OSX.

@poussa
Copy link
Contributor

poussa commented Sep 23, 2016

Now the build is nice a quiet.

@poussa poussa merged commit 0b0cd33 into intel:master Sep 23, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants