Question about std::string #253
-
This probably shows the depth of my ignorance about the compiler system, and happy to move it to a discussion group instead if that's more appropriate. I was starting work on an example of how we might do dynamic configuration of compartments, and hit what I'm sure is noob issue with std:;string If I change the examples/01.hello_world/hello.cc to try an use std::string
xmake gives:
If I remove the call to Debug so I just have the definition
xmake fails with:
compile_commands.json includes the following - that I assume should be picking up strlen ?
Feels like I'm missing something obvious about using std::string ? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi, the strlen function is provided by the string library. We pay almost no penalty from splitting things into different libraries and so we’ve split the traditional libc up quite a lot, so you can build small, firmware images with only the subset that you need. We should add an overload for the debug adaptor (patches welcome!) that forwards to the Putting |
Beta Was this translation helpful? Give feedback.
-
It looks as if there’s also a compiler bug. The strlen is being lowered as a compiler intrinsic but is then not having the correct calling convention applied when it’s expanded. |
Beta Was this translation helpful? Give feedback.
As of #260,
std::string
is expected to work.