Re: make fails on master

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

Alex Aycinena-2
John,

On Sun, Jun 7, 2015 at 1:34 PM, John Ralls <[hidden email]> wrote:

>
> > On Jun 7, 2015, at 12:38 PM, Derek Atkins <[hidden email]> 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?

Best regards,

Alex
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

John Ralls-2

> On Jun 14, 2015, at 6:44 PM, Alex Aycinena <[hidden email]> wrote:
>
> John,
>
> On Sun, Jun 7, 2015 at 1:34 PM, John Ralls <[hidden email] <mailto:[hidden email]>> wrote:
>
> > On Jun 7, 2015, at 12:38 PM, Derek Atkins <[hidden email] <mailto:[hidden email]>> 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
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

Christian Stimming-4
Aren't you just missing an #include <string.h> which is needed for strdup()
... ?

Regards,

Christian

Am Sonntag, 14. Juni 2015, 19:42:55 schrieb John Ralls:
> > On Jun 14, 2015, at 6:44 PM, Alex Aycinena <[hidden email]>
> > wrote:
> >
> > John,
> >
> > On Sun, Jun 7, 2015 at 1:34 PM, John Ralls <[hidden email]
<mailto:[hidden email]>> wrote:

> > > On Jun 7, 2015, at 12:38 PM, Derek Atkins <[hidden email]
> > > <mailto:[hidden email]>> 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.");>          
> >                          ^


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

John Ralls-2

> On Jun 15, 2015, at 1:58 PM, Christian Stimming <[hidden email]> wrote:
>
> Aren't you just missing an #include <string.h> which is needed for strdup()
> ... ?
>

Nope, line 10.

Regards,
John Ralls


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

Alex Aycinena-2
John,

The config.log for the F21 system that builds properly does show CFLAGS as
-std=gnu99, but the config.log for the F22 system that doesn't build, shows
CFLAGS as -std=c11. I checked to make sure the configure.ac file on the F22
does have the 'ac_cv_cstd=gnu99' line that you had previously pushed and,
as expected, it does. When I re-run './autogen.sh', then switch to the
build directory and run 'configure', at the end it shows 'CFLAGS
............... : -g  -std=c11 -g'. I do not understand what causes the
difference. Doesn't autogen.sh use configure.ac to regenerate configure?
And wouldn't your change cause the CFLAGS to be set as on the F21 system?
Any guidance?

Thanks,

Alex

On Mon, Jun 15, 2015 at 2:04 PM, John Ralls <[hidden email]> wrote:

>
> > On Jun 15, 2015, at 1:58 PM, Christian Stimming <[hidden email]>
> wrote:
> >
> > Aren't you just missing an #include <string.h> which is needed for
> strdup()
> > ... ?
> >
>
> Nope, line 10.
>
> Regards,
> John Ralls
>
>
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

Alex Aycinena-2
John,

I just noticed that in the configure.ac file, line 332 says
'ac_cv_cstd=gnu99' but line 336 says 'ac_cv_cstd=c11'. If I change line 336
locally to also say 'ac_cv_cstd=gnu99', then autogen.sh does regenerate
configure with CFLAGS set to gnu99 and make, make-check and make-install
all work on the F22 machine. Should that be changed on master, and, if so,
will you do it? Or would you like me to do it?

Thanks,

Alex

On Wed, Jun 17, 2015 at 3:22 PM, Alex Aycinena <[hidden email]>
wrote:

> John,
>
> The config.log for the F21 system that builds properly does show CFLAGS
> as  -std=gnu99, but the config.log for the F22 system that doesn't build,
> shows CFLAGS as -std=c11. I checked to make sure the configure.ac file on
> the F22 does have the 'ac_cv_cstd=gnu99' line that you had previously
> pushed and, as expected, it does. When I re-run './autogen.sh', then switch
> to the build directory and run 'configure', at the end it shows 'CFLAGS
> ............... : -g  -std=c11 -g'. I do not understand what causes the
> difference. Doesn't autogen.sh use configure.ac to regenerate configure?
> And wouldn't your change cause the CFLAGS to be set as on the F21 system?
> Any guidance?
>
> Thanks,
>
> Alex
>
> On Mon, Jun 15, 2015 at 2:04 PM, John Ralls <[hidden email]> wrote:
>
>>
>> > On Jun 15, 2015, at 1:58 PM, Christian Stimming <[hidden email]>
>> wrote:
>> >
>> > Aren't you just missing an #include <string.h> which is needed for
>> strdup()
>> > ... ?
>> >
>>
>> Nope, line 10.
>>
>> Regards,
>> John Ralls
>>
>>
>
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

John Ralls-2

> On Jun 17, 2015, at 4:03 PM, Alex Aycinena <[hidden email]> wrote:
>
> John,
>
> I just noticed that in the configure.ac <http://configure.ac/> file, line 332 says 'ac_cv_cstd=gnu99' but line 336 says 'ac_cv_cstd=c11'. If I change line 336 locally to also say 'ac_cv_cstd=gnu99', then autogen.sh does regenerate configure with CFLAGS set to gnu99 and make, make-check and make-install all work on the F22 machine. Should that be changed on master, and, if so, will you do it? Or would you like me to do it?

Alex,

That check is there because certain versions of GLib require C11 because someone introduced a C11 feature into one of the header files. Ryan Lortie took that out a few weeks ago, so if GC is building OK then the version of GLib that F22 includes must be after Ryan’s commit or be patched to reflect it. I guess that means we need to use AC_COMPILE_IFELSE instead of simply checking the GLib version.

http://stackoverflow.com/questions/19641460/using-strdup-in-c11 <http://stackoverflow.com/questions/19641460/using-strdup-in-c11> suggests that strdup isn’t part of C11 after all and that the correct solution is to use gnu11 instead of c11. Can you test that? If it works go ahead and push that change and I’ll do the compile check on the GLib header tomorrow.

Regards,
John Ralls

_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

John Ralls-2

> On Jun 17, 2015, at 5:42 PM, John Ralls <[hidden email]> wrote:
>
>
>> On Jun 17, 2015, at 4:03 PM, Alex Aycinena <[hidden email]> wrote:
>>
>> John,
>>
>> I just noticed that in the configure.ac <http://configure.ac/> file, line 332 says 'ac_cv_cstd=gnu99' but line 336 says 'ac_cv_cstd=c11'. If I change line 336 locally to also say 'ac_cv_cstd=gnu99', then autogen.sh does regenerate configure with CFLAGS set to gnu99 and make, make-check and make-install all work on the F22 machine. Should that be changed on master, and, if so, will you do it? Or would you like me to do it?
>
> Alex,
>
> That check is there because certain versions of GLib require C11 because someone introduced a C11 feature into one of the header files. Ryan Lortie took that out a few weeks ago, so if GC is building OK then the version of GLib that F22 includes must be after Ryan’s commit or be patched to reflect it. I guess that means we need to use AC_COMPILE_IFELSE instead of simply checking the GLib version.
>
> http://stackoverflow.com/questions/19641460/using-strdup-in-c11 <http://stackoverflow.com/questions/19641460/using-strdup-in-c11> suggests that strdup isn’t part of C11 after all and that the correct solution is to use gnu11 instead of c11. Can you test that? If it works go ahead and push that change and I’ll do the compile check on the GLib header tomorrow.

Alex,

I’ve pushed a commit that uses gnu11 instead of c11 and checks for being able to include gio.h to decide which to use. That should work better with F22, and is regardless a better approach than pinning on GLib version numbers.

Regards,
John Ralls


_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
Reply | Threaded
Open this post in threaded view
|

Re: make fails on master

Alex Aycinena-2
John,

I haven't been able to get back to this until just now. First I tried your
test of replacing configure.ac line 336, 'ac_cv_cstd=c11' with
'ac_cv_cstd=gnu11' and that worked on Fedora 22. Then I put it back the way
it was and pulled down your commit and tried again and that too worked. I
can confirm that it all now works as it should on both F21 and F22.

Thanks,

Alex

On Thu, Jun 18, 2015 at 3:05 PM, John Ralls <[hidden email]> wrote:

>
> > On Jun 17, 2015, at 5:42 PM, John Ralls <[hidden email]> wrote:
> >
> >
> >> On Jun 17, 2015, at 4:03 PM, Alex Aycinena <[hidden email]>
> wrote:
> >>
> >> John,
> >>
> >> I just noticed that in the configure.ac <http://configure.ac/> file,
> line 332 says 'ac_cv_cstd=gnu99' but line 336 says 'ac_cv_cstd=c11'. If I
> change line 336 locally to also say 'ac_cv_cstd=gnu99', then autogen.sh
> does regenerate configure with CFLAGS set to gnu99 and make, make-check and
> make-install all work on the F22 machine. Should that be changed on master,
> and, if so, will you do it? Or would you like me to do it?
> >
> > Alex,
> >
> > That check is there because certain versions of GLib require C11 because
> someone introduced a C11 feature into one of the header files. Ryan Lortie
> took that out a few weeks ago, so if GC is building OK then the version of
> GLib that F22 includes must be after Ryan’s commit or be patched to reflect
> it. I guess that means we need to use AC_COMPILE_IFELSE instead of simply
> checking the GLib version.
> >
> > http://stackoverflow.com/questions/19641460/using-strdup-in-c11 <
> http://stackoverflow.com/questions/19641460/using-strdup-in-c11> suggests
> that strdup isn’t part of C11 after all and that the correct solution is to
> use gnu11 instead of c11. Can you test that? If it works go ahead and push
> that change and I’ll do the compile check on the GLib header tomorrow.
>
> Alex,
>
> I’ve pushed a commit that uses gnu11 instead of c11 and checks for being
> able to include gio.h to decide which to use. That should work better with
> F22, and is regardless a better approach than pinning on GLib version
> numbers.
>
> Regards,
> John Ralls
>
>
_______________________________________________
gnucash-devel mailing list
[hidden email]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel