Re: complie error in current trunk

2012-12-21 Thread Geert Janssens

On 21-12-12 07:45, Mike Alexander wrote:
--On December 20, 2012 5:00:56 PM +0100 Geert Janssens 
janssens-ge...@telenet.be wrote:



This may be a side effect of my efforts to make GnuCash build and run
with guile 2. I'm not sure why I didn't get these warnings on my
system.

Anyway, just to test, can you alter src/base-typemaps.i as follows:
on line 19, there is
%typemap (out) char * {

Can you just below this line insert this:
   $result = SCM_UNSPECIFIED;

And then compile again ?


I'll have to admit that I got this error too and didn't fix or report 
it.  I just turned off the warning so I could finish what else I was 
doing and then forgot about it.


The error is probably dependent on exactly what compiler you are using 
since it depends on the flow analysis done during optimization.  In my 
case I was using gcc 4.6.3 when I got the error.


I tried the fix you suggest above and it seems to solve, or at least 
avoid, the problem.


 Mike


Thanks for the feedback. I have committed the change.

FWIW, my compiler is gcc 4.7.2 on Fedora 17. I'm compiling with -Werror 
but it doesn't produce the warning reported. It think it's a valid 
warning in this case though.


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


Re: complie error in current trunk

2012-12-21 Thread Herbert Thoma
Am 21.12.2012 10:43, schrieb Geert Janssens:
 On 21-12-12 07:45, Mike Alexander wrote:
 --On December 20, 2012 5:00:56 PM +0100 Geert Janssens 
 janssens-ge...@telenet.be wrote:

 This may be a side effect of my efforts to make GnuCash build and run
 with guile 2. I'm not sure why I didn't get these warnings on my
 system.

 Anyway, just to test, can you alter src/base-typemaps.i as follows:
 on line 19, there is
 %typemap (out) char * {

 Can you just below this line insert this:
$result = SCM_UNSPECIFIED;

 And then compile again ?

 I'll have to admit that I got this error too and didn't fix or report it.  I 
 just turned off the warning so I could finish what else I was doing and then 
 forgot about it.

 The error is probably dependent on exactly what compiler you are using since 
 it depends on the flow analysis done during optimization.  In my case I was 
 using gcc 4.6.3 when I got the error.

 I tried the fix you suggest above and it seems to solve, or at least avoid, 
 the problem.

  Mike

 Thanks for the feedback. I have committed the change.
 
 FWIW, my compiler is gcc 4.7.2 on Fedora 17. I'm compiling with -Werror but 
 it doesn't produce the warning reported. It think it's a valid warning in 
 this case though.

I confirm that the fix fixes the error on my system as well.

Thank you!

 Herbert.

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


Re: r22651 - gnucash/trunk/src - Guile 2: replace deprecated SCM_SYMBOL_CHARS function

2012-12-21 Thread Alex Aycinena
Geert,

On Sat, Dec 15, 2012 at 9:58 AM, Geert Janssens
gjanss...@code.gnucash.org wrote:
 Author: gjanssens
 Date: 2012-12-15 12:58:40 -0500 (Sat, 15 Dec 2012)
 New Revision: 22651
 Trac: http://svn.gnucash.org/trac/changeset/22651

 Added:
gnucash/trunk/src/core-utils/gnc-guile-utils.c
gnucash/trunk/src/core-utils/gnc-guile-utils.h
 Modified:
gnucash/trunk/src/app-utils/guile-util.c
gnucash/trunk/src/app-utils/guile-util.h
gnucash/trunk/src/app-utils/option-util.c
gnucash/trunk/src/core-utils/Makefile.am
gnucash/trunk/src/engine/engine-helpers.c
gnucash/trunk/src/gnome/dialog-tax-info.c
gnucash/trunk/src/import-export/qif-import/assistant-qif-import.c
 Log:
 Guile 2: replace deprecated SCM_SYMBOL_CHARS function

 The replacements require guile 1.8 or above

 ___
 gnucash-patches mailing list
 gnucash-patc...@gnucash.org
 https://lists.gnucash.org/mailman/listinfo/gnucash-patches

A couple of years ago, I used valgrind to find and correct memory
leaks in some code I had previously committed. In that process I
discovered that some of my leaks were caused by
'scm_to_locale_string'.

I investigated on the internet and found that to prevent memory leaks
in scm_to_locale_string() per the guile manual (see
'http://www.gnu.org/software/guile/manual/html_node/Dynamic-Wind.html#Dynamic-Wind),
you needed to surround scm_to_locale_string() with calls to
scm_dynwind_begin (0) and scm_dynwind_free (str) followed by
scm_dynwind_end ().

So I added the code that you have removed with this commit. I also
added it in many more places, including in code that I hadn't
committed, to clear up more memory leaks. Later, I realized that I
should refactor my code to replace all the instances that I had put it
in with a call to gnc_scm_to_locale_string. I haven't got around to
that last part yet but it is on my to do list.

So my questions to you are:

1. were you aware of the memory leak issue with gnc_scm_to_locale_string?
2. has something changed between then and now that make this no longer
an issue and therefore the code no longer necessary?
3. does moving from guile 1.2 to guile 2 affect this in some way?

Regards,

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