Felicia Lim
2017-Jul-12 17:58 UTC
[opus] [PATCH] Avoid -Wsometimes-uninitialized error for valid test code
|frame_size_enum| in tests/test_opus_encode.cl:117 is flagged as potentially uninitialized but get_frame_size_enum() will fail anyway if a valid value is not found. --- tests/test_opus_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_opus_common.h b/tests/test_opus_common.h index ff7f0142..8b878607 100644 --- a/tests/test_opus_common.h +++ b/tests/test_opus_common.h @@ -64,6 +64,8 @@ static opus_uint32 iseed; #ifdef __GNUC__ __attribute__((noreturn)) +#elif _MSC_VER +__declspec(noreturn) #endif static OPUS_INLINE void _test_failed(const char *file, int line) { -- 2.13.2.932.g7449e964c-goog
James Zern
2017-Jul-12 18:01 UTC
[opus] [PATCH] Avoid -Wsometimes-uninitialized error for valid test code
On Wed, Jul 12, 2017 at 10:58 AM, Felicia Lim <flim at google.com> wrote:> |frame_size_enum| in tests/test_opus_encode.cl:117 is flagged as potentially > uninitialized but get_frame_size_enum() will fail anyway if a valid value is > not found. > --- > tests/test_opus_common.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/tests/test_opus_common.h b/tests/test_opus_common.h > index ff7f0142..8b878607 100644 > --- a/tests/test_opus_common.h > +++ b/tests/test_opus_common.h > @@ -64,6 +64,8 @@ static opus_uint32 iseed; > > #ifdef __GNUC__ > __attribute__((noreturn)) > +#elif _MSC_VERdefined(_MSC_VER) would avoid any new warnings from -Wundef.> +__declspec(noreturn) > #endif > static OPUS_INLINE void _test_failed(const char *file, int line) > { > -- > 2.13.2.932.g7449e964c-goog > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus
Jean-Marc Valin
2017-Jul-12 18:03 UTC
[opus] [PATCH] Avoid -Wsometimes-uninitialized error for valid test code
r+ with James' fix. On 12/07/17 02:01 PM, James Zern wrote:> On Wed, Jul 12, 2017 at 10:58 AM, Felicia Lim <flim at google.com> wrote: >> |frame_size_enum| in tests/test_opus_encode.cl:117 is flagged as potentially >> uninitialized but get_frame_size_enum() will fail anyway if a valid value is >> not found. >> --- >> tests/test_opus_common.h | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/tests/test_opus_common.h b/tests/test_opus_common.h >> index ff7f0142..8b878607 100644 >> --- a/tests/test_opus_common.h >> +++ b/tests/test_opus_common.h >> @@ -64,6 +64,8 @@ static opus_uint32 iseed; >> >> #ifdef __GNUC__ >> __attribute__((noreturn)) >> +#elif _MSC_VER > > defined(_MSC_VER) would avoid any new warnings from -Wundef. > >> +__declspec(noreturn) >> #endif >> static OPUS_INLINE void _test_failed(const char *file, int line) >> { >> -- >> 2.13.2.932.g7449e964c-goog >> >> _______________________________________________ >> opus mailing list >> opus at xiph.org >> http://lists.xiph.org/mailman/listinfo/opus > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >
Seemingly Similar Threads
- [PATCH] Avoid -Wsometimes-uninitialized error for valid test code
- [PATCH] Avoid -Wsometimes-uninitialized error for valid test code
- [RFC PATCH v1 2/2] armv7(float): Optimize encode usecase using NE10 library
- [PATCH 0/2] libopusfile int64 overflows
- [PATCH 0/2] libopusfile int64 overflows