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

"-std=c11" is required #3

Closed
twisteroidambassador opened this issue May 9, 2018 · 1 comment
Closed

"-std=c11" is required #3

twisteroidambassador opened this issue May 9, 2018 · 1 comment

Comments

@twisteroidambassador
Copy link

While README.md states:

Recommended CFLAGS to turn on warnings: -std=c11 -Wall -Wextra -Wpedantic

It is actually required to use "-std=c11" for the compiled library to work, otherwise problems will arise either when compiling or importing. Maybe the flag should be added to the makefiles.

Tested with GCC 4.8.5: if no "-std" flags are specified, compilation fails with

fvad.c:75:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (size_t i = 0; i < arraysize(valid_rates); i++) {
     ^
fvad.c:75:5: note: use option -std=c99 or -std=gnu99 to compile your code

and if "-std=c99" is specified, if the warnings are turned on, many warnings can be seen:

In file included from signal_processing/signal_processing_library.h:34:0,
                 from signal_processing/get_scaling_square.c:18:
signal_processing/spl_inl.h: In function ‘WebRtcSpl_CountLeadingZeros32’:
signal_processing/spl_inl.h:42:3: warning: implicit declaration of function ‘static_assert’ [-Wimplicit-function-declaration]
   RTC_COMPILE_ASSERT(sizeof(unsigned int) == sizeof(uint32_t));
   ^

using the compiled library will raise an error similar to "undefined symbol: static_assert".

@dpirch
Copy link
Owner

dpirch commented May 9, 2018

The "-std=gnu11" flag is now automatically added if necessary: ab268e5

Newer versions of gcc and clang have c11 support enabled by default, but apparently gcc pre-5 uses "-std=gnu89" by default.

@dpirch dpirch closed this as completed May 9, 2018
entn-at pushed a commit to entn-at/libfvad that referenced this issue Aug 3, 2018
…n (patchset dpirch#2 id:160001 of https://codereview.chromium.org/3002033002/ )

Reason for revert:
Fixes has landed.

Original issue's description:
> Revert of Fix the video buffer size should take rtt into consideration (patchset dpirch#3 id:40001 of https://codereview.chromium.org/2980413002/ )
>
> Reason for revert:
> We are not certain this is the behavior we want.
>
> Original issue's description:
> > Fix the video buffer size should take rtt into consideration
> >
> > BUG=webrtc:8010
> >
> > Review-Url: https://codereview.webrtc.org/2980413002
> > Cr-Commit-Position: refs/heads/master@{#19285}
> > Committed: https://chromium.googlesource.com/external/webrtc/+/f1e08d0b5848d32fd31c5b6e4e570115c32b7ce5
>
> TBR=sprang@webrtc.org,gustavogb@gmail.com
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:8010
>
> Review-Url: https://codereview.webrtc.org/3002033002
> Cr-Commit-Position: refs/heads/master@{#19442}
> Committed: https://chromium.googlesource.com/external/webrtc/+/bdbc8895f3a630a4fe28d4661d8e71877ecaf14d

TBR=sprang@webrtc.org,gustavogb@gmail.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:8010

Review-Url: https://codereview.webrtc.org/3016633002
Cr-Commit-Position: refs/heads/master@{#19944}
entn-at pushed a commit to entn-at/libfvad that referenced this issue Aug 3, 2018
…n (patchset dpirch#3 id:40001 of https://codereview.chromium.org/2980413002/ )

Reason for revert:
We are not certain this is the behavior we want.

Original issue's description:
> Fix the video buffer size should take rtt into consideration
>
> BUG=webrtc:8010
>
> Review-Url: https://codereview.webrtc.org/2980413002
> Cr-Commit-Position: refs/heads/master@{#19285}
> Committed: https://chromium.googlesource.com/external/webrtc/+/f1e08d0b5848d32fd31c5b6e4e570115c32b7ce5

TBR=sprang@webrtc.org,gustavogb@gmail.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:8010

Review-Url: https://codereview.webrtc.org/3002033002
Cr-Commit-Position: refs/heads/master@{#19442}
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