1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-08-07 06:43:00 +03:00

support: Expose TEST_VERIFY_EXIT behavior to GCC optimizers

Previously, the implementation would conditionally exit based on the
status argument, which GCC did not know about.  This leads to
false uninitialized variable warnings when data is accessed after a
TEST_VERIFY_EXIT failure (from code which would never execute).
This commit is contained in:
Florian Weimer
2017-06-09 14:08:13 +02:00
parent 6c85cc2852
commit 48bd8cda09
3 changed files with 28 additions and 8 deletions

View File

@@ -22,12 +22,16 @@
#include <stdlib.h>
void
support_test_verify_impl (int status, const char *file, int line,
const char *expr)
support_test_verify_impl (const char *file, int line, const char *expr)
{
support_record_failure ();
printf ("error: %s:%d: not true: %s\n", file, line, expr);
if (status >= 0)
exit (status);
}
void
support_test_verify_exit_impl (int status, const char *file, int line,
const char *expr)
{
support_test_verify_impl (file, line, expr);
exit (status);
}