It seems that when calling a method that has two overloaded versions like this:
f(char* format, ...)
f(char* format, va_list args)
with a second pointer argument: f("format", pointer), the second version is picked up.
I've found a description of a similar issue here: http://bugs.gentoo.org/63112
So, to resolve this ambiguity, I've named such LogMessageBuilder's Append functions differently.
Review URL: http://codereview.chromium.org/125125
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@2172
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
Log::kMessageBufferSize - pos_);
va_list args;
va_start(args, format);
- Append(format, args);
+ AppendVA(format, args);
va_end(args);
ASSERT(pos_ <= Log::kMessageBufferSize);
}
-void LogMessageBuilder::Append(const char* format, va_list args) {
+void LogMessageBuilder::AppendVA(const char* format, va_list args) {
Vector<char> buf(Log::message_buffer_ + pos_,
Log::kMessageBufferSize - pos_);
int result = v8::internal::OS::VSNPrintF(buf, format, args);
void Append(const char* format, ...);
// Append string data to the log message.
- void Append(const char* format, va_list args);
+ void AppendVA(const char* format, va_list args);
// Append a character to the log message.
void Append(const char c);
LogMessageBuilder msg;
va_list ap;
va_start(ap, format);
- msg.Append(format, ap);
+ msg.AppendVA(format, ap);
va_end(ap);
msg.WriteToLogFile();
}