Skip to content
Snippets Groups Projects
Commit ed90cdc3 authored by Ralph Giles's avatar Ralph Giles Committed by Ralph Giles
Browse files

Disable the deprecated function warning on __malloc_hook.

This just works around the deprecation in glibc 2.14. I
do worry what will happen if they follow through and
remove it in 2.15.
parent 657dea71
No related branches found
No related tags found
No related merge requests found
......@@ -1160,6 +1160,14 @@ int test_repacketizer_api(void)
}
#ifdef MALLOC_FAIL
/* GLIBC 2.14 declares __malloc_hook as deprecated, generating a warning
* under GCC. However, this is the cleanest way to test malloc failure
* handling in our codebase, and the lack of thread saftey isn't an
* issue here. We therefore disable the warning for this function.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
typedef void *(*mhook)(size_t __size, __const __malloc_ptr_t);
#endif
......@@ -1245,6 +1253,10 @@ int test_malloc_fail(void)
#endif
}
#ifdef MALLOC_FAIL
#pragma GCC diagnostic pop /* restore -Wdeprecated-declarations */
#endif
int main(int _argc, char **_argv)
{
opus_int32 total;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment