GCC 4.8 produced a cast qualifier warning.
Diff Detail
Diff Detail
Event Timeline
unittests/Support/ARMAttributeParser.cpp | ||
---|---|---|
34–35 | Weird, the template type is not const... then, shouldn't this be: ArrayRef<const uint8_t> Bytes((const uint8_t*)OS.str().c_str(), OS.str().size()); or why can't it just be const char? |
Comment Actions
It helps reading the warning message :)
../unittests/Support/ARMAttributeParser.cpp: In function ‘bool testBuildAttr(unsigned int, unsigned int, unsigned int, unsigned int)’: ../unittests/Support/ARMAttributeParser.cpp:34:52: warning: cast from type ‘const char*’ to type ‘uint8_t* {aka unsigned char*}’ casts away qualifiers [-Wcast-qual] ArrayRef<uint8_t> Bytes((uint8_t*)OS.str().c_str(), OS.str().size());
Comment Actions
The AttributeParser::Parse was defined as accepting an ArrayRef<uint8_t> so I just stuck to this. Also, the template type does not need to be const since ArrayRef always uses the type to create a const pointer from it.
Comment Actions
Maybe I'm being a bit pedantic here, but while we're at it, could we also switch to a C++ cast instead of the C-style cast?
Comment Actions
ah, I didn't see your last message and I've already committed! I will manually close this once it is accepted.
Weird, the template type is not const...
then, shouldn't this be:
or why can't it just be const char?