dennyhalim / wbar

Automatically exported from code.google.com/p/wbar
GNU General Public License v3.0
0 stars 0 forks source link

wbar-2.1.1 fails to build due to -Werror #42

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. ./configure
2. make

What is the expected output? What do you see instead?

cc1plus: warnings being treated as errors
../src/config/Run.cc: In member function ‘int Run::getPID()’:
../src/config/Run.cc:36:43: error: ignoring return value of ‘char* 
fgets(char*, int, FILE*)’, declared with attribute warn_unused_result

cc1plus: warnings being treated as errors
../src/config/Functions.cc: In function ‘void on_settings_update()’:
../src/config/Functions.cc:683:82: error: format not a string literal and no 
format arguments

Please provide any additional information below.

The above warnings might be specific to gcc-4.5. I'm not sure. But, with the 
default -Wall -Werror flags, they cause the compile to fail. I'm packaging this 
for Gentoo as an e-build, and for the time being I've applied the following 
patch to fix it:

--- src/config/Run.cc
+++ src/config/Run.cc
@@ -33,7 +33,8 @@
     if (process)
     {
         char spid[50];
-        fgets(spid, sizeof(spid), process);
+        char* tmp;
+        tmp=fgets(spid, sizeof(spid), process);
         pclose(process);

         pid = atoi(spid);
--- src/config/Functions.cc
+++ src/config/Functions.cc
@@ -680,7 +680,7 @@
                                   GTK_DIALOG_DESTROY_WITH_PARENT,
                                   GTK_MESSAGE_ERROR,
                                   GTK_BUTTONS_OK,
-                                  (_("Error save config in ") + 
filename).c_str());
+                                  "%s",(_("Error save config in ") + 
filename).c_str());

         gtk_dialog_run (GTK_DIALOG (dialog));
         gtk_widget_destroy (dialog);

Original issue reported on code.google.com by signal...@gmail.com on 23 Feb 2011 at 9:40

GoogleCodeExporter commented 9 years ago

Original comment by yadick...@gmail.com on 28 Mar 2011 at 9:44

GoogleCodeExporter commented 9 years ago
I had exactly the same error,my g++ version is:
""g++ (Ubuntu/Linaro 4.4.4-14ubuntu5) 4.4.5""

Original comment by she...@gmail.com on 18 Apr 2011 at 1:14

GoogleCodeExporter commented 9 years ago

Original comment by yadick...@gmail.com on 2 May 2011 at 10:48