- removed comment
- changed watchers to stevenrbrandt
Wrong code in Piraha.hpp
Piraha.hpp contains in lines 171 ff the code
const char c;
Literal(char b) : c(b) {}
bool match(Matcher *m);
std::string fmt() {
std::string s = "literal(";
s += c+")";
return s;
}
In this code, the expression c+")" adds a character to a pointer, in effect adding to the pointer. This does not append to the string s, as was intended.
There seem to be several similar cases in other locations as well.
Keyword:
Comments (8)
-
reporter -
- changed status to open
- assigned issue to
- removed comment
-
- removed comment
This appears to be a routine designed to aid with debugging, and is apparently not being called right now. Where else do you see the problem?
-
reporter - removed comment
I saw this error many times. Upon closer inspection it seems that this is caused by the same code in a header file.
-
- removed comment
The error you identify is inside a fmt() method, and grep shows that's not being called.
Can you give me a par file which produces the error?
-
reporter - removed comment
The error is a compiler warning, reported by Clang.
-
- changed status to resolved
- removed comment
Clang identified two problems. One was the formatting of debug code which wasn't being called. Because the relevant code was in a header, it showed up multiple times during compilation.
The second problem was a stray call to abort.
-
- edited description
- changed status to closed
- Log in to comment