Fixed pointer vs. va_list overloading problem occuring in gcc 3.3 (used for ARM build).

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
parent 00107efb
......@@ -215,13 +215,13 @@ void LogMessageBuilder::Append(const char* format, ...) {
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);
......
......@@ -230,7 +230,7 @@ class LogMessageBuilder BASE_EMBEDDED {
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);
......
......@@ -402,7 +402,7 @@ void Logger::ApiEvent(const char* format, ...) {
LogMessageBuilder msg;
va_list ap;
va_start(ap, format);
msg.Append(format, ap);
msg.AppendVA(format, ap);
va_end(ap);
msg.WriteToLogFile();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment