mirror of
https://github.com/NixOS/nix.git
synced 2025-12-24 09:50:55 +01:00
Ludo reported this error:
unexpected Nix daemon error: boost::too_few_args: format-string refered to more arguments than were passed
coming from this line:
printMsg(lvlError, run.program + ": " + string(err, 0, p));
The problem here is that the string ends up implicitly converted to a
Boost format() object, so % characters are treated specially. I
always assumed (wrongly) that strings are converted to a format object
that outputs the string as-is.
Since this assumption appears in several places that may be hard to
grep for, I've added some C++ type hackery to ensures that the right
thing happens. So you don't have to worry about % in statements like
printMsg(lvlError, "foo: " + s);
or
throw Error("foo: " + s);
|
||
|---|---|---|
| .. | ||
| affinity.cc | ||
| affinity.hh | ||
| archive.cc | ||
| archive.hh | ||
| hash.cc | ||
| hash.hh | ||
| local.mk | ||
| md5.c | ||
| md5.h | ||
| md32_common.h | ||
| serialise.cc | ||
| serialise.hh | ||
| sha1.c | ||
| sha1.h | ||
| sha256.c | ||
| sha256.h | ||
| types.hh | ||
| util.cc | ||
| util.hh | ||
| xml-writer.cc | ||
| xml-writer.hh | ||