From: mikhail.naganov@gmail.com Date: Mon, 15 Jun 2009 15:49:03 +0000 (+0000) Subject: Fixed pointer vs. va_list overloading problem occuring in gcc 3.3 (used for ARM build). X-Git-Tag: upstream/4.7.83~23905 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=91241273cbcccbb4d737ddc4a82f3710b0b437e6;p=platform%2Fupstream%2Fv8.git 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 --- diff --git a/src/log-utils.cc b/src/log-utils.cc index b3b3192b2..028eb3a01 100644 --- a/src/log-utils.cc +++ b/src/log-utils.cc @@ -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 buf(Log::message_buffer_ + pos_, Log::kMessageBufferSize - pos_); int result = v8::internal::OS::VSNPrintF(buf, format, args); diff --git a/src/log-utils.h b/src/log-utils.h index fe6f01cac..ad669d53d 100644 --- a/src/log-utils.h +++ b/src/log-utils.h @@ -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); diff --git a/src/log.cc b/src/log.cc index aae030a3a..af49128ea 100644 --- a/src/log.cc +++ b/src/log.cc @@ -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(); }