build: update default CXXFLAGS.
* Add -std=c++03 and -pedantic, and fix the resulting warnings. The
long-long-int warning is explicitly suppressed because it's not
trivial to workaround in a platform-independent and ISO-conformant
way without using C++11.
* Initial support for building with -std=c++11 (experimental).
* Prefer -Og optimization level in debug builds if supported by the
compiler.
Change-Id: I744a25c8b52842dc3ea3a733d6ab2fa66171e6f8
diff --git a/tests/face/ndnlp.cpp b/tests/face/ndnlp.cpp
index 7681e86..66a1c84 100644
--- a/tests/face/ndnlp.cpp
+++ b/tests/face/ndnlp.cpp
@@ -28,6 +28,8 @@
#include "tests/test-common.hpp"
+#include <boost/scoped_array.hpp>
+
namespace nfd {
namespace tests {
@@ -161,9 +163,9 @@
Block
makeBlock(size_t valueLength)
{
- uint8_t blockValue[valueLength];
- memset(blockValue, 0xcc, sizeof(blockValue));
- return ndn::dataBlock(0x01, blockValue, sizeof(blockValue));
+ boost::scoped_array<uint8_t> blockValue(new uint8_t[valueLength]);
+ memset(blockValue.get(), 0xcc, valueLength);
+ return ndn::dataBlock(0x01, blockValue.get(), valueLength);
}
protected: