> On Jun 14, 2015, at 6:44 PM, Alex Aycinena <alex.aycin...@gmail.com> wrote:
> 
> John,
> 
> On Sun, Jun 7, 2015 at 1:34 PM, John Ralls <jra...@ceridwen.us 
> <mailto:jra...@ceridwen.us>> wrote:
> 
> > On Jun 7, 2015, at 12:38 PM, Derek Atkins <de...@ihtfp.com 
> > <mailto:de...@ihtfp.com>> wrote:
> >
> >
> > On Sun, June 7, 2015 3:02 pm, John Ralls wrote:
> >
> >> Alex,
> >>
> >> Turns out that for some flavors of GCC -std=gnu99 is required for strdup
> >> to be provided. I’d made the default c99, which in those cases doesn’t
> >> support it, hence the error.
> >>
> >> Fixed and pushed.
> >
> > Why are we using strdup() and not g_strdup()?
> 
> Oversight? It’s used in several places. The earliest I found was a5d4c7cf 
> from 2004.
> 
> Regards,
> John Ralls
> 
> 
> I upgraded My Fedora 20 machine to Fedora 22, which came out a few weeks ago, 
> and got the same problem again. In order to make sure it was not my new build 
> environment, I cloned a new gnucash, checked out maint, and was able to make, 
> make-clean, and make-install OK. So the new F22 build environment is OK. But 
> when I checked out master on the new clone and wiped out my build directory 
> and tried make again, I got the same error, as follows:
> 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c: In function 
> 'gfec_catcher':
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:60:25: error: 
> implicit declaration of function 'strdup' 
> [-Werror=implicit-function-declaration]
>          *(char**)data = strdup("Guile error: Too many recursions in error 
> catch handler.");
>                          ^
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:60:23: error: 
> assignment makes pointer from integer without a cast [-Werror=int-conversion]
>          *(char**)data = strdup("Guile error: Too many recursions in error 
> catch handler.");
>                        ^
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:79:13: 
> warning: 'scm_internal_stack_catch' is deprecated [-Wdeprecated-declarations]
>              scm_internal_stack_catch(SCM_BOOL_T,
>              ^
> In file included from /usr/include/guile/2.0/libguile.h:126:0,
>                  from 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.h:12,
>                  from 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:13:
> /usr/include/guile/2.0/libguile/deprecated.h:648:45: note: declared here
>  SCM_DEPRECATED SCM scm_internal_stack_catch (SCM tag,
>                                              ^
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:99:23: error: 
> assignment makes pointer from integer without a cast [-Werror=int-conversion]
>          *(char**)data = strdup("Error running guile function.");
>                        ^
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:103:23: 
> error: assignment makes pointer from integer without a cast 
> [-Werror=int-conversion]
>          *(char**)data = strdup(msg);
>                        ^
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c: In function 
> 'gfec_eval_string':
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:135:5: 
> warning: 'scm_internal_stack_catch' is deprecated [-Wdeprecated-declarations]
>      result = scm_internal_stack_catch(SCM_BOOL_T,
>      ^
> In file included from /usr/include/guile/2.0/libguile.h:126:0,
>                  from 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.h:12,
>                  from 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:13:
> /usr/include/guile/2.0/libguile/deprecated.h:648:45: note: declared here
>  SCM_DEPRECATED SCM scm_internal_stack_catch (SCM tag,
>                                              ^
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c: In function 
> 'gfec_apply':
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:203:5: 
> warning: 'scm_internal_stack_catch' is deprecated [-Wdeprecated-declarations]
>      result = scm_internal_stack_catch(SCM_BOOL_T,
>      ^
> In file included from /usr/include/guile/2.0/libguile.h:126:0,
>                  from 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.h:12,
>                  from 
> /home/gnucash-dev/gitcheckouts/gnucash-new/src/app-utils/gfec.c:13:
> /usr/include/guile/2.0/libguile/deprecated.h:648:45: note: declared here
>  SCM_DEPRECATED SCM scm_internal_stack_catch (SCM tag,
>                                              ^
> cc1: all warnings being treated as errors
> Makefile:860: recipe for target 'gfec.lo' failed
> make[4]: *** [gfec.lo] Error 1
> make[4]: Leaving directory 
> '/home/gnucash-dev/gitcheckouts/gnucash-new-build/src/app-utils'
> 
> So your last fix seems to have worked for F20 & F21 but not for F22. Is there 
> any further information I can provide you?

Alex,

Well, make sure that it’s getting -std=gnu99 in CFLAGS, for one. Then root 
around in /usr/include and try to figure out why strdup isn’t being declared.

If all else fails we can just replace the dozen-or-so instances with g_strdup, 
which will suffice until those are all replaced with std::string::operator=().

Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel

Reply via email to