Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

‘for’ loop initial declarations within plugins/input_uvc/v4l2uvc.c may break compilation #170

Closed
daghemo opened this issue Oct 19, 2018 · 1 comment

Comments

@daghemo
Copy link

daghemo commented Oct 19, 2018

I'm getting the following error when compiling mjpg-streamer on a Raspberry Pi with Debian jessie:

mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/v4l2uvc.c:969:5: error: ‘for’ loop initial declarations are only allowed in C99 or C11 mode
     for (int i = 0; i < NB_BUFFER; i++) {
     ^
mjpg-streamer/mjpg-streamer-experimental/plugins/input_uvc/v4l2uvc.c:969:5: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code

Latest version on GCC defaults to C99 compatibility, but not the one running on my Raspberry Pi. :)
Would it be possibile to add "std=c99" or something like that into the Makefile? Or maybe just modifying the plugins/input_uvc/v4l2uvc.c as of commit 29fb2b9, changing from:

    for (int i = 0; i < NB_BUFFER; i++) {
        munmap(vd->mem[i], vd->buf.length);
    }

To:

    int i;
    for (i = 0; i < NB_BUFFER; i++) {
        munmap(vd->mem[i], vd->buf.length);
    }
@jacksonliam
Copy link
Owner

Ahhh good spot, yes will modify the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants