Should be better now :)

Gianfranco



>________________________________
> Da: Gianfranco Costamagna <[email protected]>
>A: Oliver Bock <[email protected]>; David Anderson 
><[email protected]>; Guo Yixuan <[email protected]> 
>Cc: "[email protected]" <[email protected]> 
>Inviato: Martedì 23 Aprile 2013 15:06
>Oggetto: Re: [boinc_dev] boinc_dev Digest, Vol 107, Issue 6
> 
>
>
>This is the second part, from Guo Yixuan, I changed in the patch the author 
>line, I hope it's enough for giving credits to him!
>
>
>
>Just my 0.02 $
>
>
>Gianfranco
>
>
>
>>________________________________
>> Da: Oliver Bock <[email protected]>
>>A: Gianfranco Costamagna <[email protected]> 
>>Cc: "[email protected]" <[email protected]> 
>>Inviato: Martedì 23 Aprile 2013 14:25
>>Oggetto: Re: [boinc_dev] boinc_dev Digest, Vol 107, Issue 6
>> 
>>
>>On 4/23/13 14:23 , Oliver Bock wrote:
>>> On 4/23/13 14:09 , Gianfranco Costamagna wrote:
>>>> Sorry Oliver, what about sending patches in the debian format?
>>>> I use dpkg-source for creating them, but I can use format patch too.
>>> 
>>> Regular patches don't contain any meta data, like author and datetime
>>> information. git format-patch (followed by git am) does. It's somewhat
>>> important to be able to attribute a given commit/patch to the original
>>> author if, say, in a year from now someone needs additional information
>>> about its content/implementation. You want to be able to ask the
 patch's
>>> original author about it.
>>
>>Also, you might want to get credit for your work :-)
>>
>>
>>
>>
>
>
From c262b00c8f0f917547327705e4bb0d9402824909 Mon Sep 17 00:00:00 2001
From: Guo Yixuan <[email protected]>
Date: Tue, 23 Apr 2013 15:03:03 +0200
Subject: [PATCH] Add standard flags to custom Makefiles.
 There're several hand-written Makefiles among other Makefiles by automake, they don't take CXXFLAGS and CPPFLAGS from environment.

---
 samples/example_app/Makefile |    6 +++---
 samples/sleeper/Makefile     |    4 ++--
 samples/worker/Makefile      |    4 ++--
 samples/wrapper/Makefile     |    4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/samples/example_app/Makefile b/samples/example_app/Makefile
index dc3e4af..bb03742 100644
--- a/samples/example_app/Makefile
+++ b/samples/example_app/Makefile
@@ -6,7 +6,7 @@ BOINC_LIB_DIR = $(BOINC_DIR)/lib
 BOINC_ZIP_DIR = $(BOINC_DIR)/zip
 FREETYPE_DIR = /usr/include/freetype2
 
-CXXFLAGS = -g \
+CXXFLAGS += -g \
 	-Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fno-common \
     -DAPP_GRAPHICS \
     -I$(BOINC_DIR) \
@@ -62,12 +62,12 @@ install: uc2
 # because otherwise you might get a version in /usr/lib etc.
 
 uc2: uc2.o libstdc++.a $(BOINC_API_DIR)/libboinc_api.a $(BOINC_LIB_DIR)/libboinc.a
-	$(CXX) $(CXXFLAGS) -o uc2 uc2.o libstdc++.a -pthread \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o uc2 uc2.o libstdc++.a -pthread \
 	$(BOINC_API_DIR)/libboinc_api.a \
 	$(BOINC_LIB_DIR)/libboinc.a
 
 uc2_graphics: uc2_graphics.o ttfont.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_graphics2.a
-	$(CXX) $(CXXFLAGS) -o uc2_graphics uc2_graphics.o ttfont.o libstdc++.a -pthread \
+	$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o uc2_graphics uc2_graphics.o ttfont.o libstdc++.a -pthread \
 	$(BOINC_API_DIR)/libboinc_graphics2.a \
 	$(BOINC_API_DIR)/libboinc_api.a \
 	$(BOINC_LIB_DIR)/libboinc.a \
diff --git a/samples/sleeper/Makefile b/samples/sleeper/Makefile
index 13492ec..be2edbd 100644
--- a/samples/sleeper/Makefile
+++ b/samples/sleeper/Makefile
@@ -4,7 +4,7 @@ BOINC_DIR = ../..
 BOINC_API_DIR = $(BOINC_DIR)/api
 BOINC_LIB_DIR = $(BOINC_DIR)/lib
 
-CXXFLAGS = -g \
+CXXFLAGS += -g \
     -I$(BOINC_DIR) \
     -I$(BOINC_LIB_DIR) \
     -I$(BOINC_API_DIR) \
@@ -26,4 +26,4 @@ distclean:
 	/bin/rm -f $(PROGS) *.o libstdc++.a
 
 sleeper: sleeper.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a
-	g++ $(CXXFLAGS) -o sleeper sleeper.o libstdc++.a -pthread -lboinc_api -lboinc
+	g++ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o sleeper sleeper.o libstdc++.a -pthread -lboinc_api -lboinc
diff --git a/samples/worker/Makefile b/samples/worker/Makefile
index 4abe4d9..61ab9ff 100644
--- a/samples/worker/Makefile
+++ b/samples/worker/Makefile
@@ -1,4 +1,4 @@
-CXXFLAGS = -g 
+CXXFLAGS += -g
 
 PROGS = worker
 
@@ -11,4 +11,4 @@ distclean:
 	rm $(PROGS)
 
 worker: worker.o
-	g++ $(CXXFLAGS) -o worker worker.o
+	g++ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o worker worker.o
diff --git a/samples/wrapper/Makefile b/samples/wrapper/Makefile
index 226a28d..bf33bca 100644
--- a/samples/wrapper/Makefile
+++ b/samples/wrapper/Makefile
@@ -6,7 +6,7 @@ BOINC_API_DIR = $(BOINC_DIR)/api
 BOINC_LIB_DIR = $(BOINC_DIR)/lib
 BOINC_ZIP_DIR = $(BOINC_DIR)/zip
 
-CXXFLAGS = -g -O0 \
+CXXFLAGS += -g -O0 \
 	-Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -fno-common \
     -I$(BOINC_DIR) \
     -I$(BOINC_LIB_DIR) \
@@ -38,4 +38,4 @@ REGEXP_OBJS = \
 	regexp_report.o
 
 wrapper: wrapper.o libstdc++.a $(BOINC_LIB_DIR)/libboinc.a $(BOINC_API_DIR)/libboinc_api.a $(REGEXP_OBJS)
-	g++ $(CXXFLAGS) -o wrapper wrapper.o $(REGEXP_OBJS) libstdc++.a -pthread -lboinc_api -lboinc -lboinc_zip
+	g++ $(CXXFLAGS) $(CPPFLAGS) $(LDFLAGS) -o wrapper wrapper.o $(REGEXP_OBJS) libstdc++.a -pthread -lboinc_api -lboinc -lboinc_zip
-- 
1.7.10.4

From 0ed4aa22b8425184fce7b3644865e9ab2c5fb177 Mon Sep 17 00:00:00 2001
From: Gianfranco Costamagna <[email protected]>
Date: Tue, 23 Apr 2013 14:59:45 +0200
Subject: [PATCH] Fixed FTBFS with gcc hardening flags enabled.
Now you can use hardening flags while building boinc as described here without FTBFS
http://wiki.debian.org/Hardening#dpkg-buildflags

---
 client/cs_account.cpp   |    2 +-
 client/cs_benchmark.cpp |    2 +-
 client/main.cpp         |   12 ++++++------
 client/work_fetch.cpp   |    2 +-
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/client/cs_account.cpp b/client/cs_account.cpp
index 04d1981..f3693c6 100644
--- a/client/cs_account.cpp
+++ b/client/cs_account.cpp
@@ -79,7 +79,7 @@ int PROJECT::write_account_file() {
     fprintf(f, "<project_preferences>\n%s</project_preferences>\n",
         project_prefs.c_str()
     );
-    fprintf(f, gui_urls.c_str());
+    fprintf(f, "%s" ,gui_urls.c_str());
     fprintf(f, "</account>\n");
     fclose(f);
     retval = boinc_rename(TEMP_ACCT_FILE_NAME, path);
diff --git a/client/cs_benchmark.cpp b/client/cs_benchmark.cpp
index d2b485b..e41302f 100644
--- a/client/cs_benchmark.cpp
+++ b/client/cs_benchmark.cpp
@@ -462,7 +462,7 @@ bool CLIENT_STATE::cpu_benchmarks_poll() {
             }
             ndone++;
             if (benchmark_descs[i].error) {
-                msg_printf(0, MSG_INFO, benchmark_descs[i].error_str);
+                msg_printf(0, MSG_INFO, "%s", benchmark_descs[i].error_str);
                 had_error = true;
             }
         }
diff --git a/client/main.cpp b/client/main.cpp
index c358280..4b64add 100644
--- a/client/main.cpp
+++ b/client/main.cpp
@@ -82,7 +82,7 @@ void log_message_startup(const char* msg) {
         time_string, msg
     );
     if (!gstate.executing_as_daemon) {
-        fprintf(stdout, evt_msg);
+        fprintf(stdout, "%s", evt_msg);
     } else {
 #ifdef _WIN32
         LogEventInfoMessage(evt_msg);
@@ -91,7 +91,7 @@ void log_message_startup(const char* msg) {
 #elif defined (ANDROID)
         __android_log_print(ANDROID_LOG_INFO, "BOINC", evt_msg);
 #else
-        syslog(LOG_DAEMON|LOG_INFO, evt_msg);
+        syslog(LOG_DAEMON|LOG_INFO, "%s", evt_msg);
 #endif
     }
 }
@@ -115,7 +115,7 @@ void log_message_error(const char* msg) {
     );
 #endif
     if (!gstate.executing_as_daemon) {
-        fprintf(stderr, evt_msg);
+        fprintf(stderr, "%s", evt_msg);
     } else {
 #ifdef _WIN32
         LogEventErrorMessage(evt_msg);
@@ -124,7 +124,7 @@ void log_message_error(const char* msg) {
 #elif defined (ANDROID)
         __android_log_print(ANDROID_LOG_ERROR, "BOINC", evt_msg);
 #else
-        syslog(LOG_DAEMON|LOG_ERR, evt_msg);
+        syslog(LOG_DAEMON|LOG_ERR, "%s", evt_msg);
 #endif
     }
 }
@@ -138,7 +138,7 @@ void log_message_error(const char* msg, int error_code) {
         time_string, msg, error_code
     );
     if (!gstate.executing_as_daemon) {
-        fprintf(stderr, evt_msg);
+        fprintf(stderr, "%s", evt_msg);
     } else {
 #ifdef _WIN32
         LogEventErrorMessage(evt_msg);
@@ -147,7 +147,7 @@ void log_message_error(const char* msg, int error_code) {
 #elif defined (ANDROID)
         __android_log_print(ANDROID_LOG_ERROR, "BOINC", evt_msg);
 #else
-        syslog(LOG_DAEMON|LOG_ERR, evt_msg);
+        syslog(LOG_DAEMON|LOG_ERR, "%s", evt_msg);
 #endif
     }
 }
diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp
index 4022ce2..ebf3d3c 100644
--- a/client/work_fetch.cpp
+++ b/client/work_fetch.cpp
@@ -848,7 +848,7 @@ void WORK_FETCH::write_request(FILE* f, PROJECT* p) {
     if (log_flags.work_fetch_debug) {
         char buf[256];
         request_string(buf);
-        msg_printf(p, MSG_INFO, buf);
+        msg_printf(p, MSG_INFO, "%s", buf);
     }
 }
 
-- 
1.7.10.4

_______________________________________________
boinc_dev mailing list
[email protected]
http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev
To unsubscribe, visit the above URL and
(near bottom of page) enter your email address.

Reply via email to