WalkingDead1234 / google-glog

Automatically exported from code.google.com/p/google-glog
Other
0 stars 0 forks source link

unused parameters in mock-log.h #217

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What is the expected output? What do you see instead?
I expect it to compile.

clang -Wall -Werror -Wextra -std=c++11 -O1 -fno-omit-frame-pointer -c 
my_test.cc -o my_test.o
In file included from my_test.cc:11:
./src/mock-log.h:118:33: error: unused parameter 'base_filename' 
[-Werror,-Wunused-parameter]
                    const char* base_filename, int line, const tm* tm_time,
                                ^
./src/mock-log.h:118:52: error: unused parameter 'line' 
[-Werror,-Wunused-parameter]
                    const char* base_filename, int line, const tm* tm_time,
                                                   ^
./src/mock-log.h:118:68: error: unused parameter 'tm_time' 
[-Werror,-Wunused-parameter]
                    const char* base_filename, int line, const tm* tm_time,

What version of the product are you using? On what operating system?
debian wheezy.

$ clang --version
Debian clang version 3.4-3 (tags/RELEASE_34/rc2) (based on LLVM 3.4)

The following fixes it for me.

diff --git a/src/mock-log.h b/src/mock-log.h
index 5b21811..26d7daa 100644
--- a/src/mock-log.h
+++ b/src/mock-log.h
@@ -115,8 +115,9 @@ class ScopedMockLog : public GOOGLE_NAMESPACE::LogSink {
   // WaitTillSent() and Log() are executed in the same thread.
   virtual void send(GOOGLE_NAMESPACE::LogSeverity severity,
                     const char* full_filename,
-                    const char* base_filename, int line, const tm* tm_time,
-                    const char* message, size_t message_len) {
+                    const char* /*base_filename*/, int /*line*/,
+                    const tm* /*tm_time*/, const char* message,
+                    size_t message_len) {
     // We are only interested in the log severity, full file name, and
     // log message.
     message_info_.severity = severity;

Original issue reported on code.google.com by aus...@peloton-tech.com on 31 Jul 2014 at 6:40