Romel Sandoval <ro...@lavabit.com> writes:

> After configure while trying to build I got this:
>
> ..
> Making all in g-wrap
> make[2]: se ingresa al directorio `/home/romel/src/g-wrap/g-wrap'
> make  all-am
> make[3]: se ingresa al directorio `/home/romel/src/g-wrap/g-wrap'
> /bin/bash ../libtool --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H -I.
> -I..  -I..  -I/home/romel/usr/include
> -I/home/romel/usr/include/guile/2.0  -g -O2 -Wall -Wmissing-prototypes
> -Werror -std=gnu99 -MT core-runtime.lo -MD -MP
> -MF .deps/core-runtime.Tpo -c -o core-runtime.lo core-runtime.c
> libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I..
> -I/home/romel/usr/include -I/home/romel/usr/include/guile/2.0 -g -O2
> -Wall -Wmissing-prototypes -Werror -std=gnu99 -MT core-runtime.lo -MD
> -MP -MF .deps/core-runtime.Tpo -c core-runtime.c  -fPIC -DPIC
> -o .libs/core-runtime.o
> cc1: warnings being treated as errors
> core-runtime.c: In function ‘gw_raise_error’:
> core-runtime.c:55: error: ignoring return value of ‘vasprintf’, declared
> with attribute warn_unused_result
>
Could you try the attached patch? It should fix this issue. As noted by
Andy Wingo, you can also use `--disable-Werror' when running configure.

diff --git a/g-wrap/core-runtime.c b/g-wrap/core-runtime.c
index cb0f310..66c24a5 100644
--- a/g-wrap/core-runtime.c
+++ b/g-wrap/core-runtime.c
@@ -1,5 +1,5 @@
 /**********************************************************************
-Copyright (C) 2003-2004 Andreas Rottmann
+Copyright (C) 2003-2004, 2010 Andreas Rottmann
  
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as
@@ -50,15 +50,21 @@ gw_raise_error (GWLangArena arena, const char *proc, const char *fmt, ...)
 {
   char *message = NULL;
   va_list args;
-
+  int bytes_allocated;
+  
   va_start (args, fmt);
-  vasprintf (&message, fmt, args);
+  bytes_allocated = vasprintf (&message, fmt, args);
   va_end (args);
-  
-  gw_lang->raise_error (arena, proc, message);
-  
-  /* FIXME: we leak 'message' here, since this line won't be reached */
-  free (message);
+
+  if (bytes_allocated >= 0)
+  {
+    gw_lang->raise_error (arena, proc, message);
+    
+    /* FIXME: we leak 'message' here, since this line won't be reached */
+    free (message);
+  }
+  else
+    gw_lang->raise_error (arena, proc, "could not allocate error message");
 }
 
 void
Regards, Rotty
-- 
Andreas Rottmann -- <http://rotty.yi.org/>

Reply via email to