-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
AVRO-3960: [C] Fix st ANYARGS warning #2798
Conversation
@@ -212,7 +212,7 @@ void st_free_table(st_table *table) | |||
} | |||
|
|||
#define PTR_NOT_EQUAL(table, ptr, hash_val, key) \ | |||
((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (key), (ptr)->key))) | |||
((ptr) != 0 && (ptr->hash != (hash_val) || !EQUAL((table), (void*) (key), (void*) (ptr)->key))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the explicit casts to void*
needed here and below for MSVC? Or is there some other reason to have them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
without the void*
casts, we get -Wpointer-integer-compare
warnings due to st_data_t
being a uintptr_t
the other call-sites throughout /avro/lang/c
pass in pointers so the cast is only needed for st.c
Thanks, it's good to have the deprecation warnings go away. One thing I would suggest, though, since Does it sound reasonable? |
This removes the following warning: avro/lang/c/src/st.c:240:13: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] hash_val = do_hash(key, table); Signed-off-by: Sahil Kang <[email protected]> Signed-off-by: Sahil Kang <[email protected]>
good idea, I changed the macros to typedefs |
Thank you, @SahilKang ! |
This removes the following warning: avro/lang/c/src/st.c:240:13: warning: passing arguments to a function without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] hash_val = do_hash(key, table); Signed-off-by: Sahil Kang <[email protected]> Signed-off-by: Sahil Kang <[email protected]>
AVRO-3960
What is the purpose of the change
This removes the following warning:
Verifying this change
This change is already covered by existing tests, such as
make test
Documentation
No new features are added