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

Already on GitHub? Sign in to your account

Underlying type cast issue in st.c. #486

Closed
monaka opened this Issue Oct 10, 2012 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

monaka commented Oct 10, 2012

I got some warnings in st.c when I complied st.c with -Wcast-align option.
I could fix it with this patch.

Is it worth to send a pull request?
I'll reave it as is if you're going to rewrite st.c.

diff --git a/src/st.c b/src/st.c
index 1fd859b..e0c2ed9 100644
--- a/src/st.c
+++ b/src/st.c
@@ -49,7 +49,7 @@ static void rehash(st_table*);
 #endif

 #define alloc(type) (type*)malloc((unsigned)sizeof(type))
-#define Calloc(n,s) (char*)calloc((n),(s))
+#define Calloc(n,s) (void*)calloc((n),(s))

 #define EQUAL(table,x,y) ((x)==(y) || (*table->type->compare)((x),(y)) == 0)
Owner

matz commented Oct 16, 2012

st.c will be removed soon. So I don't want to touch it.

@matz matz closed this Oct 16, 2012

Contributor

monaka commented Oct 16, 2012

Thanks, I see.
I leave it as is.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment