[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: gaf.git: branch: master updated (1.5.0-20080706-275-g2c2bfc9)



The branch, master has been updated
       via  2c2bfc91b4cff115df6528d375042096d8046664 (commit)
       via  09eacbfb36e2b00758bce8d8add2f8f56cdcfdbb (commit)
       via  ab3e5337562359df11e8b679096574b2c01fdbc7 (commit)
      from  f9f3eec945746a3f1ed6683fb861d21c4e8a2048 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========

 gattrib/src/Makefile.am   |    2 +-
 gnetlist/src/Makefile.am  |    2 +-
 gschem/src/Makefile.am    |    2 +-
 gschem/src/x_dialog.c     |   16 ++++++----------
 gschem/src/x_fileselect.c |   10 +++++-----
 gsymcheck/src/Makefile.am |    2 +-
 libgeda/src/Makefile.am   |    2 +-
 libgeda/src/a_basic.c     |    5 ++++-
 libgeda/src/f_basic.c     |   16 ++++++++++++----
 libgeda/src/f_print.c     |    5 ++++-
 libgeda/src/s_page.c      |    5 ++++-
 utils/src/Makefile.am     |    2 +-
 12 files changed, 41 insertions(+), 28 deletions(-)


=================
 Commit Messages
=================

commit 2c2bfc91b4cff115df6528d375042096d8046664
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Nov 1 16:09:26 2008 +0000

    Placeholders for fixing some warn-unused bugs in libgeda

:100644 100644 00b6c2a... c4fd0ec... M	libgeda/src/a_basic.c
:100644 100644 4ba4da5... d5f976f... M	libgeda/src/f_basic.c
:100644 100644 1f268c2... fb83db8... M	libgeda/src/f_print.c
:100644 100644 0d8e664... 52cd7ad... M	libgeda/src/s_page.c

commit 09eacbfb36e2b00758bce8d8add2f8f56cdcfdbb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Nov 1 16:09:26 2008 +0000

    Use -Werror when building with gcc compilers.
    
    Hopefully this will help to ensure compiler
    warnings get noticed and fixed by developers.

:100644 100644 c446e51... ffcbafc... M	gattrib/src/Makefile.am
:100644 100644 4cb6a0d... 0df82a4... M	gnetlist/src/Makefile.am
:100644 100644 c47bf73... 57454b1... M	gschem/src/Makefile.am
:100644 100644 773dd7f... d570f0d... M	gsymcheck/src/Makefile.am
:100644 100644 5e3be39... e3ef0b4... M	libgeda/src/Makefile.am
:100644 100644 1f8d730... 12ba8d3... M	utils/src/Makefile.am

commit ab3e5337562359df11e8b679096574b2c01fdbc7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Nov 1 16:09:26 2008 +0000

    gschem: Fix more non-literal format strings which cause compiler warnings.
    
    We should be careful to avoid passing arbitrary strings into functions
    which take printf style arguments. In that case, always use the construct
    ("%s", string) rather than passing string as the format argument.

:100644 100644 63f162f... 958f1ea... M	gschem/src/x_dialog.c
:100644 100644 b0212a7... ee31f6a... M	gschem/src/x_fileselect.c

=========
 Changes
=========

commit 2c2bfc91b4cff115df6528d375042096d8046664
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Nov 1 16:09:26 2008 +0000

    Placeholders for fixing some warn-unused bugs in libgeda

diff --git a/libgeda/src/a_basic.c b/libgeda/src/a_basic.c
index 00b6c2a..c4fd0ec 100644
--- a/libgeda/src/a_basic.c
+++ b/libgeda/src/a_basic.c
@@ -223,7 +223,10 @@ int o_save(TOPLEVEL *toplevel, const char *filename)
   }
 
   buffer = o_save_buffer (toplevel);
-  fwrite (buffer, strlen(buffer), 1, fp);
+  if (fwrite (buffer, strlen(buffer), 1, fp) != 1) {
+    /* An error occurred with fwrite */
+#warning FIXME: What do we do?
+  }
   g_free (buffer);
   fclose (fp);
 
diff --git a/libgeda/src/f_basic.c b/libgeda/src/f_basic.c
index 4ba4da5..d5f976f 100644
--- a/libgeda/src/f_basic.c
+++ b/libgeda/src/f_basic.c
@@ -229,8 +229,10 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
   file_directory = g_dirname (full_filename);
 
   if (file_directory) { 
-    chdir(file_directory);  
-    /*! \bug Probably should do some checking of chdir return values */
+    if (chdir (file_directory)) {
+      /* Error occurred with chdir */
+#warning FIXME: What do we do?
+    }
   }
 
   /* Now open RC and process file */
@@ -315,7 +317,10 @@ int f_open_flags(TOPLEVEL *toplevel, const gchar *filename,
   /* Reset the directory to the value it had when f_open was
    * called. */
   if (flags & F_OPEN_RESTORE_CWD) {
-    chdir(saved_cwd);
+    if (chdir (saved_cwd)) {
+      /* Error occurred with chdir */
+#warning FIXME: What do we do?
+    }
     g_free(saved_cwd);
   }
 
@@ -452,7 +457,10 @@ int f_save(TOPLEVEL *toplevel, const char *filename)
     /* Restore permissions. */
     chmod (real_filename, st.st_mode);
 #ifdef HAVE_CHOWN
-    chown (real_filename, st.st_uid, st.st_gid);
+    if (chown (real_filename, st.st_uid, st.st_gid)) {
+      /* Error occured with chown */
+#warning FIXME: What do we do?
+    }
 #endif
 
     g_free (real_filename);
diff --git a/libgeda/src/f_print.c b/libgeda/src/f_print.c
index 1f268c2..fb83db8 100644
--- a/libgeda/src/f_print.c
+++ b/libgeda/src/f_print.c
@@ -160,7 +160,10 @@ int f_print_header(TOPLEVEL *toplevel, FILE *fp,
   do {
     bytes = fread(buf, 1, PROLOG_BUFFER_SIZE, prolog);
     if(ferror(prolog)) break;
-    fwrite(buf, 1, bytes, fp);
+    if (fwrite(buf, 1, bytes, fp) != bytes) {
+      /* An error occurred  with fwrite */
+#warning FIXME: What do we do?
+    }
   } while(!feof(prolog) && !ferror(prolog) && !ferror(fp));
 
   if(ferror(prolog)) {
diff --git a/libgeda/src/s_page.c b/libgeda/src/s_page.c
index 0d8e664..52cd7ad 100644
--- a/libgeda/src/s_page.c
+++ b/libgeda/src/s_page.c
@@ -258,7 +258,10 @@ void s_page_goto (TOPLEVEL *toplevel, PAGE *p_new)
   toplevel->page_current = p_new;
 
   dirname = g_dirname (p_new->page_filename);
-  chdir (dirname);
+  if (chdir (dirname)) {
+    /* An error occured with chdir */
+#warning FIXME: What do we do?
+  }
   g_free (dirname);
 
 }

commit 09eacbfb36e2b00758bce8d8add2f8f56cdcfdbb
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Nov 1 16:09:26 2008 +0000

    Use -Werror when building with gcc compilers.
    
    Hopefully this will help to ensure compiler
    warnings get noticed and fixed by developers.

diff --git a/gattrib/src/Makefile.am b/gattrib/src/Makefile.am
index c446e51..ffcbafc 100644
--- a/gattrib/src/Makefile.am
+++ b/gattrib/src/Makefile.am
@@ -2,7 +2,7 @@
 ## This Makefile.am created for gattrib by SDB 12.13.2003
 
 if CCISGCC
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -Werror
 endif
 
 bin_PROGRAMS = gattrib
diff --git a/gnetlist/src/Makefile.am b/gnetlist/src/Makefile.am
index 4cb6a0d..0df82a4 100644
--- a/gnetlist/src/Makefile.am
+++ b/gnetlist/src/Makefile.am
@@ -10,7 +10,7 @@ gnetlist_SOURCES = \
 		s_rename.c s_hierarchy.c s_misc.c vams_misc.c
 
 if CCISGCC
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -Werror
 endif
 
 INCLUDES = -I$(top_srcdir)/include @GNETLIST_CFLAGS@
diff --git a/gschem/src/Makefile.am b/gschem/src/Makefile.am
index c47bf73..57454b1 100644
--- a/gschem/src/Makefile.am
+++ b/gschem/src/Makefile.am
@@ -77,7 +77,7 @@ gschem_SOURCES += ${CAIRO_SRCS}
 endif
 
 if CCISGCC
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -Werror
 endif
 
 INCLUDES = -I$(prefix)/include -I$(top_srcdir)/intl -I$(top_srcdir)/include @GSCHEM_CFLAGS@
diff --git a/gsymcheck/src/Makefile.am b/gsymcheck/src/Makefile.am
index 773dd7f..d570f0d 100644
--- a/gsymcheck/src/Makefile.am
+++ b/gsymcheck/src/Makefile.am
@@ -15,7 +15,7 @@ gsymcheck_SOURCES = \
 	s_symstruct.c
 
 if CCISGCC
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -Werror
 endif
 
 INCLUDES = -I$(top_srcdir)/include @GSYMCHECK_CFLAGS@
diff --git a/libgeda/src/Makefile.am b/libgeda/src/Makefile.am
index 5e3be39..e3ef0b4 100644
--- a/libgeda/src/Makefile.am
+++ b/libgeda/src/Makefile.am
@@ -6,7 +6,7 @@
 AUTOMAKE_OPTIONS = foreign
 
 if CCISGCC
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -Werror
 endif
 
 # Build a libtool library, libhello.la for installation in libdir.
diff --git a/utils/src/Makefile.am b/utils/src/Makefile.am
index 1f8d730..12ba8d3 100644
--- a/utils/src/Makefile.am
+++ b/utils/src/Makefile.am
@@ -4,7 +4,7 @@ bin_PROGRAMS = gmk_sym smash_megafile convert_sym sarlacc_schem olib \
 	       gsch2pcb grenum
 
 if CCISGCC
-AM_CFLAGS = -Wall
+AM_CFLAGS = -Wall -Werror
 endif
 
 # don't forget all *.h files */

commit ab3e5337562359df11e8b679096574b2c01fdbc7
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Date:   Sat Nov 1 16:09:26 2008 +0000

    gschem: Fix more non-literal format strings which cause compiler warnings.
    
    We should be careful to avoid passing arbitrary strings into functions
    which take printf style arguments. In that case, always use the construct
    ("%s", string) rather than passing string as the format argument.

diff --git a/gschem/src/x_dialog.c b/gschem/src/x_dialog.c
index 63f162f..958f1ea 100644
--- a/gschem/src/x_dialog.c
+++ b/gschem/src/x_dialog.c
@@ -2699,13 +2699,11 @@ void generic_msg_dialog (const char *msg)
   GtkWidget *dialog;
 
   dialog = gtk_message_dialog_new (NULL,
-
-
-                                   GTK_DIALOG_MODAL
-                                   | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                   GTK_DIALOG_MODAL |
+                                     GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_INFO,
                                    GTK_BUTTONS_OK,
-                                   msg);
+                                   "%s", msg);
 
   gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);
@@ -2727,13 +2725,11 @@ int generic_confirm_dialog (const char *msg)
   gint r;
 
   dialog = gtk_message_dialog_new (NULL,
-
-
-                                   GTK_DIALOG_MODAL
-                                   | GTK_DIALOG_DESTROY_WITH_PARENT,
+                                   GTK_DIALOG_MODAL |
+                                     GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_INFO,
                                    GTK_BUTTONS_OK_CANCEL,
-                                   msg);
+                                   "%s", msg);
 
   r = gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);
diff --git a/gschem/src/x_fileselect.c b/gschem/src/x_fileselect.c
index b0212a7..ee31f6a 100644
--- a/gschem/src/x_fileselect.c
+++ b/gschem/src/x_fileselect.c
@@ -337,11 +337,11 @@ int x_fileselect_load_backup(TOPLEVEL *toplevel, GString *message)
 
   g_string_append(message, "\nIf you load the original file, the backup file will be overwritten in the next autosave timeout and it will be lost.\n\nDo you want to load the backup file?\n");
 
-  dialog = gtk_message_dialog_new(GTK_WINDOW(w_current->main_window),
-			  GTK_DIALOG_MODAL,
-			  GTK_MESSAGE_QUESTION,
-			  GTK_BUTTONS_YES_NO,
-			  message->str);
+  dialog = gtk_message_dialog_new (GTK_WINDOW(w_current->main_window),
+                                   GTK_DIALOG_MODAL,
+                                   GTK_MESSAGE_QUESTION,
+                                   GTK_BUTTONS_YES_NO,
+                                   "%s", message->str);
 
   /* Set the alternative button order (ok, cancel, help) for other systems */
   gtk_dialog_set_alternative_button_order(GTK_DIALOG(dialog),




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs