Compile error fix for volume.app 1.1a
Saturday, 22 Sep 2007 [Sunday, 23 Sep 2007]
Quick note. I was recently reinstalling my laptop and found that my favourite way to control sound volume, volume.app 1.1a, no longer compiles:
mixer-oss.c: In function 'get_mixer_state':
mixer-oss.c:105: error: subscripted value is neither array nor pointer
There have been no changes to the program in six years, so I assume it’s because GCC’s interpretation of the standards has become stricter in the time since.
To my disappointment, Google found hardly any hits for the error message, much less a solution to the problem. I investigated for myself; turns out it’s a mere triviality. So I threw together a quick corrective patch to put up here, so the next person to run into the problem will hopefully end up here via Google. Share and enjoy.
Update: Perry Lorier is miffed that I didn’t explain why renaming that variable fixes the problem. Answer: I have no idea. I just know that it used to work, and now it doesn’t, so there must be something on that line which GCC no longer likes. The double use of the same identifier as both a struct and variable name was the only apparent potential problem, and indeed changing it fixed the problem. I’m happy to leave it at that.