From 45a89e832db35e03c6345ea1fe4cd1c1570ba89a Mon Sep 17 00:00:00 2001 From: Scott Mann Date: Wed, 24 Aug 2011 19:53:11 +0000 Subject: [PATCH] Fix compilation failure in ATF due to gcc4.6.0 "improvements." RT #25598. --- CHANGES | 2 ++ unit/atf-src/atf-c++/detail/application_test.cpp | 3 --- unit/atf-src/atf-c/check.c | 3 +-- unit/atf-src/atf-c/detail/process_test.c | 5 ++--- unit/atf-src/atf-c/tp_test.c | 3 --- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index 497b571ec7..d7ba6677d8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,5 @@ +3146. [test] Fixed gcc4.6.0 errors in ATF. [RT #25598] + --- 9.9.0a1 released --- 3145. [test] Capture output of ATF unit tests in "./atf.out" if diff --git a/unit/atf-src/atf-c++/detail/application_test.cpp b/unit/atf-src/atf-c++/detail/application_test.cpp index 7fa1cd6ab6..ca7dfe2472 100644 --- a/unit/atf-src/atf-c++/detail/application_test.cpp +++ b/unit/atf-src/atf-c++/detail/application_test.cpp @@ -52,16 +52,13 @@ public: char *const argv[] = { arg1, arg2, arg3, arg4, NULL }; int ch; - bool zflag; // Given that this obviously is an application, and that we used the // same driver to start, we can test getopt(3) right here without doing // any fancy stuff. - zflag = false; while ((ch = ::getopt(argc, argv, ":Z")) != -1) { switch (ch) { case 'Z': - zflag = true; break; case '?': diff --git a/unit/atf-src/atf-c/check.c b/unit/atf-src/atf-c/check.c index 86c00c5cd4..610063ba1d 100644 --- a/unit/atf-src/atf-c/check.c +++ b/unit/atf-src/atf-c/check.c @@ -301,13 +301,12 @@ atf_check_result_init(atf_check_result_t *r, const char *const *argv, const atf_fs_path_t *dir) { atf_error_t err; - const char *workdir; r->pimpl = malloc(sizeof(struct atf_check_result_impl)); if (r->pimpl == NULL) return atf_no_memory_error(); - workdir = atf_config_get("atf_workdir"); + (void) atf_config_get("atf_workdir"); err = array_to_list(argv, &r->pimpl->m_argv); if (atf_is_error(err)) diff --git a/unit/atf-src/atf-c/detail/process_test.c b/unit/atf-src/atf-c/detail/process_test.c index feafa1dc4a..b76500d935 100644 --- a/unit/atf-src/atf-c/detail/process_test.c +++ b/unit/atf-src/atf-c/detail/process_test.c @@ -135,13 +135,12 @@ capture_stream_process(void *v, atf_process_child_t *c) { struct capture_stream *s = v; - bool eof; switch (s->m_base.m_type) { case stdout_type: - eof = read_line(atf_process_child_stdout(c), &s->m_msg); + (void) read_line(atf_process_child_stdout(c), &s->m_msg); break; case stderr_type: - eof = read_line(atf_process_child_stderr(c), &s->m_msg); + (void) read_line(atf_process_child_stderr(c), &s->m_msg); break; default: UNREACHABLE; diff --git a/unit/atf-src/atf-c/tp_test.c b/unit/atf-src/atf-c/tp_test.c index 54d9e3568c..fc48ef928f 100644 --- a/unit/atf-src/atf-c/tp_test.c +++ b/unit/atf-src/atf-c/tp_test.c @@ -54,16 +54,13 @@ ATF_TC_BODY(getopt, tc) char *const argv[] = { arg1, arg2, arg3, arg4, NULL }; int ch; - bool zflag; /* Given that this obviously is a test program, and that we used the * same driver to start, we can test getopt(3) right here without doing * any fancy stuff. */ - zflag = false; while ((ch = getopt(argc, argv, ":Z")) != -1) { switch (ch) { case 'Z': - zflag = true; break; case '?':