summaryrefslogtreecommitdiff
path: root/libstdc++-v3/testsuite/27_io/basic_streambuf
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/testsuite/27_io/basic_streambuf')
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc5
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/char/9701-3.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc13
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc13
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc2
12 files changed, 36 insertions, 29 deletions
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc
index c599985d43f..318ff033ef7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/3.cc
@@ -118,7 +118,7 @@ class gnu_sbuf: public std::basic_streambuf<gnu_char_type, gnu_char_traits>
void test07()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
try
{ gnu_sbuf obj; }
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc
index c48ecbcc43d..9400a599bfc 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/cons/char/1.cc
@@ -46,7 +46,7 @@ public:
bool
check_pointers()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( this->eback() == NULL );
VERIFY( this->gptr() == NULL );
VERIFY( this->egptr() == NULL );
@@ -92,8 +92,7 @@ void test01()
typedef testbuf::traits_type traits_type;
typedef testbuf::int_type int_type;
- bool test = true;
- char* lit01 = "chicago underground trio/possible cube on delmark";
+ bool test __attribute__((unused)) = true;
testbuf buf01;
// 27.5.2.1 basic_streambuf ctors
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
index 7dbfdc75562..17d94af7001 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/9322.cc
@@ -47,7 +47,7 @@ public:
void test08()
{
using std::locale;
- bool test = true;
+ bool test __attribute__((unused)) = true;
locale loc;
testbuf ob;
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/char/9701-3.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/char/9701-3.cc
index 4f98839d907..5dc68c62b9a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/char/9701-3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/in_avail/char/9701-3.cc
@@ -35,7 +35,7 @@ public:
void test01()
{
using namespace std;
- bool test = true;
+ bool test __attribute__((unused)) = true;
const char* name = "tmp_file1";
Derived_fbuf df2;
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
index 2a3a4be1a25..d2a42effc6b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/1.cc
@@ -46,7 +46,7 @@ public:
bool
check_pointers()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( this->eback() == NULL );
VERIFY( this->gptr() == NULL );
VERIFY( this->egptr() == NULL );
@@ -92,8 +92,9 @@ void test01()
typedef testbuf::traits_type traits_type;
typedef testbuf::int_type int_type;
- bool test = true;
- char* lit01 = "chicago underground trio/possible cube on delmark";
+ bool test __attribute__((unused)) = true;
+ char lit01[52];
+ strcpy(lit01, "chicago underground trio/possible cube on delmark");
testbuf buf01;
// pbackfail
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc
index dcee654b213..a6215529251 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/2.cc
@@ -60,7 +60,7 @@ template<typename T>
void test03()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
const std::string control01("11111");
std::string test01;
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc
index 1b6cf0cf332..145e4eb3ec6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/overflow/char/3599.cc
@@ -43,14 +43,14 @@ public:
protected:
int_type
- overflow(int_type c = traits_type::eof())
+ overflow(int_type c __attribute__((unused)) = traits_type::eof())
{ return traits_type::not_eof(0); }
};
void
test07()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
testbuf ob;
std::ostream out(&ob);
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
index d2833831e72..72a67de7135 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetc/char/1.cc
@@ -46,7 +46,7 @@ public:
bool
check_pointers()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( this->eback() == NULL );
VERIFY( this->gptr() == NULL );
VERIFY( this->egptr() == NULL );
@@ -92,8 +92,9 @@ void test01()
typedef testbuf::traits_type traits_type;
typedef testbuf::int_type int_type;
- bool test = true;
- char* lit01 = "chicago underground trio/possible cube on delmark";
+ bool test __attribute__((unused)) = true;
+ char lit01[52];
+ strcpy(lit01, "chicago underground trio/possible cube on delmark");
testbuf buf01;
// 27.5.2.3.1 get area
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
index f1392dc631d..f4c67c8389c 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sgetn/char/1.cc
@@ -46,7 +46,7 @@ public:
bool
check_pointers()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( this->eback() == NULL );
VERIFY( this->gptr() == NULL );
VERIFY( this->egptr() == NULL );
@@ -92,8 +92,13 @@ void test02()
typedef testbuf::traits_type traits_type;
typedef testbuf::int_type int_type;
- bool test = true;
- char* lit01 = "chicago underground trio/possible cube on delmark";
+ bool test __attribute__((unused)) = true;
+
+ const char* lit00 = "chicago underground trio/possible cube on delmark";
+ size_t i01 = traits_type::length(lit00);
+ char lit01[i01];
+ strcpy(lit01, lit00);
+
testbuf buf01;
// 27.5.2.1 basic_streambuf ctors
@@ -104,7 +109,7 @@ void test02()
VERIFY( buf01.getloc() == std::locale() );
// 27.5.2.2.5 Put area
- size_t i01 = traits_type::length(lit01);
+
char carray01[i01];
std::memset(carray01, 0, i01);
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
index b90e3d50858..e9c6e2aa6a6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputbackc/char/9538.cc
@@ -29,7 +29,7 @@ class MyTraits : public std::char_traits<char>
public:
static bool eq(char c1, char c2)
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( c1 != 'X' );
VERIFY( c2 != 'X' );
return std::char_traits<char>::eq(c1, c2);
@@ -52,13 +52,13 @@ public:
// libstdc++/9538
void test08()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
MyBuf mb;
mb.sputbackc('a');
}
-main()
+int main()
{
test08();
return 0;
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
index 0feabcd08cd..7859b3f3029 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sputn/char/1.cc
@@ -46,7 +46,7 @@ public:
bool
check_pointers()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
VERIFY( this->eback() == NULL );
VERIFY( this->gptr() == NULL );
VERIFY( this->egptr() == NULL );
@@ -92,14 +92,15 @@ void test01()
typedef testbuf::traits_type traits_type;
typedef testbuf::int_type int_type;
- bool test = true;
- char* lit01 = "chicago underground trio/possible cube on delmark";
+ bool test __attribute__((unused)) = true;
testbuf buf01;
- int i01 = 3;
// sputn/xsputn
- char* lit02 = "isotope 217: the unstable molecule on thrill jockey";
- int i02 = std::strlen(lit02);
+ const char* lit01 = "isotope 217: the unstable molecule on thrill jockey";
+ const int i02 = std::strlen(lit01);
+ char lit02[i02];
+ std::strcpy(lit02, lit01);
+
char carray[i02 + 1];
std::memset(carray, 0, i02 + 1);
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc
index 8e2d3c0aef7..5c75185774b 100644
--- a/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/sync/char/1057.cc
@@ -76,7 +76,7 @@ public:
// libstdc++/1057
void test04()
{
- bool test = true;
+ bool test __attribute__((unused)) = true;
std::string text = "abcdefghijklmn";
// 01