Fix -Wstring-compare testcase build failure
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.cp / try_catch.cc
index 051ed594e73459dd3fba163b7ff08614e44186e8..5f454f41ec5ff3f5febea8a910fc1288d9866298 100644 (file)
@@ -1,6 +1,6 @@
 /* This test script is part of GDB, the GNU debugger.
 
-   Copyright 2002-2015 Free Software Foundation, Inc.
+   Copyright 2002-2020 Free Software Foundation, Inc.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -18,6 +18,7 @@
 #include <exception>
 #include <stdexcept>
 #include <string>
+#include <string.h>
 
 enum region { oriental, egyptian, greek, etruscan, roman };
 
@@ -129,8 +130,8 @@ int main()
     }
   catch (exception& obj)
     {
-      if (obj.what() != "gdb.1")       // marker 3-catch
+      if (strcmp (obj.what(), "gdb.1") != 0)   // marker 3-catch
        test &= false;
     }
-  return 0;
+  return 0;    // marker test-complete
 }
This page took 0.024054 seconds and 4 git commands to generate.