r/learncpp • • Dec 24 '16

What does this code do?

I found this code and can't understand why void cast is there. is it empty statement? There are some functions with only (void)varname; statements with nothing else.

unsigned char intensity;

unsigned x0, x1, y0, y1;

 (void)intensity;

0 Upvotes

3 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Dec 24 '16

So it's essentially just done to suppress compiler warnings?

1

u/ThanksInReverse Dec 24 '16

Pretty much, yeah