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:
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user