Skip to content
Permalink
Browse files

Avoid "jump to label crosses initialization" error.

Move variable "buffer" into the while loop to avoid a compile error
with g++ 4.9.0.

Although earlier compiler versions did accept the code, jumping into the
scope of an variable length array is not allowed:
http://gcc.gnu.org/onlinedocs/gcc-4.3.0/gcc/Variable-Length.html
  • Loading branch information...
chkr-private authored and hacst committed Apr 28, 2014
1 parent abad339 commit 349436284b5f1baa61836c98ff0d518392140c5d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/mumble/OSS.cpp
@@ -243,9 +243,9 @@ void OSSInput::run() {
eMicFormat = SampleShort;
initializeMixer();

short buffer[iMicLength];

while (bRunning) {
short buffer[iMicLength];

int len = static_cast<int>(iMicLength * iMicChannels * sizeof(short));
ssize_t l = read(fd, buffer, len);
if (l != len) {

0 comments on commit 3494362

Please sign in to comment.
You can’t perform that action at this time.