Another Clang report.

* iface/nips/nips.cc (format_state): Do not use a variable-sized
array, this is not allowed in C++.
This commit is contained in:
Alexandre Duret-Lutz 2010-11-27 14:29:28 +01:00
parent 019c85dff6
commit 8156766fe3
2 changed files with 13 additions and 3 deletions

View file

@ -1,3 +1,10 @@
2010-11-27 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Another Clang report.
* iface/nips/nips.cc (format_state): Do not use a variable-sized
array, this is not allowed in C++.
2010-11-27 Alexandre Duret-Lutz <adl@lrde.epita.fr> 2010-11-27 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Fix more errors reported by Clang. Fix more errors reported by Clang.

View file

@ -1,4 +1,4 @@
// Copyright (C) 2008 Laboratoire de Recherche et Développement // Copyright (C) 2008, 2010 Laboratoire de Recherche et Développement
// de l'Epita (LRDE). // de l'Epita (LRDE).
// //
// This file is part of Spot, a model checking library. // This file is part of Spot, a model checking library.
@ -339,11 +339,14 @@ namespace spot
{ {
const state_nips* s = dynamic_cast<const state_nips*>(state); const state_nips* s = dynamic_cast<const state_nips*>(state);
unsigned size = global_state_to_str(s->get_state(), 0, 0, 0); unsigned size = global_state_to_str(s->get_state(), 0, 0, 0);
char buf[size]; char* buf = new char[size];
global_state_to_str(s->get_state(), 0, buf, size); global_state_to_str(s->get_state(), 0, buf, size);
return std::string(buf); std::string res(buf);
delete buf;
return res;
} }
bdd bdd