468,513 Members | 927 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

What's the meaning of (void) cast?

The following function is quoted from Judy source code:

//
************************************************** **************************
// J U D Y F R E E

void JudyFree(
void * PWord,
Word_t Words)
{
(void) Words;
free(PWord);

} // JudyFree()
Obviously, this is a wrapper routine to free memory. However, what's
the purpose of (void)Words ?
Also, learned from the calling codes, I think the second parameter is
the size of memory pointed by the first parameter.

Thanks

---
zf

Jan 7 '08 #1
1 3982
alex wrote:
The following function is quoted from Judy source code:

//
************************************************** **************************
// J U D Y F R E E

void JudyFree(
void * PWord,
Word_t Words)
{
(void) Words;
free(PWord);

} // JudyFree()
Obviously, this is a wrapper routine to free memory. However, what's
the purpose of (void)Words ?
It's probably there to suppress unused parameter warnings from some
compilers.

--
Ian Collins.
Jan 7 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

51 posts views Thread by jacob navia | last post: by
67 posts views Thread by neilcancer | last post: by
15 posts views Thread by Steven T. Hatton | last post: by
30 posts views Thread by Bill Reid | last post: by
18 posts views Thread by Richard Eich | last post: by
31 posts views Thread by Tommy | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.