Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As I pointed out above, in gcc you can explicitly mark variables as potentially unused.



And what do you suggest for MSVC, which doesn't support attribute unused or have any comparable declspecs?


If what you say is true, then you have to either put up with the warnings, compile at a level that doesn't have the warnings, or figure out a hack around them - I don't like any of those options.

I'm not as dogmatic as some others are in the thread. I just think it's a good idea to be warned when a variable is unused, enough that I'll mark my very few that might be #ifdef'ed out. If you're using a compiler that doesn't let you mark variables as such... well that sucks. You do what you can.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: