#1536: Wrong code in Piraha.hpp ----------------------+----------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: critical | Milestone: Component: Cactus | Version: development version Keywords: | ----------------------+----------------------------------------------------- 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.
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: Type: defect | Status: new Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by eschnett):
* cc: sbrandt@… (added)
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+---------------------------------------------------- Changes (by sbrandt):
* owner: => sbrandt * status: new => assigned
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by sbrandt):
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?
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
I saw this error many times. Upon closer inspection it seems that this is caused by the same code in a header file.
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by sbrandt):
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?
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: assigned Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: | Keywords: -----------------------+----------------------------------------------------
Comment (by eschnett):
The error is a compiler warning, reported by Clang.
#1536: Wrong code in Piraha.hpp -----------------------+---------------------------------------------------- Reporter: eschnett | Owner: sbrandt Type: defect | Status: closed Priority: critical | Milestone: Component: Cactus | Version: development version Resolution: fixed | Keywords: -----------------------+---------------------------------------------------- Changes (by sbrandt):
* status: assigned => closed * resolution: => fixed
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.
trac@lists.einsteintoolkit.org