unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Peter Teeson <peter.teeson@me.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: 13342@debbugs.gnu.org, guile-devel@gnu.org
Subject: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7
Date: Sun, 27 Jan 2013 16:35:04 -0500	[thread overview]
Message-ID: <39E86B9E-8939-4F1C-9DFE-2071010E1E70__24038.7997044765$1359322571$gmane$org@me.com> (raw)
In-Reply-To: <87a9ru7m23.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2244 bytes --]

Hi Ludo:
MacOS 10.7.5 Intel Dual CPU quad cores 

Many thanks for your reply. A nice demo but, no disrespect, maybe not really the issue.
Looking at the generated code from each compiler was going to be my next step after
taking a look at the stack and regs to see what got passed/pushed/popped in the call to test_sum.
Which is why I posted about how can I debug/step through the interpreter. 
I still don't understand how to do that even though I read through the manual.

My experiment in building guile with both compilers indicate they both produce the same error.
bad return from expression `(f-sum -1 2000 -30000 40000000000)': expected 39999971999; got 39999972255
I am still of the opinion that it's an interpreter issue and not a compiler one. 

I ask for help in confirming my understanding of this scheme code from the file 
/test-suite/standalone/test-ffi
;;
;; Multiple int args of differing types
;;
(define f-sum
  (pointer->procedure int64 (dynamic-func "test_ffi_sum" lib)
                      (list int8 int16 int32 int64)))
(test (f-sum -1 2000 -30000 40000000000)  ;; This calls the c function f-sum
      (+ -1 2000 -30000 40000000000))	     ;;  This executes the scheme interpreter to do the sum

Is my understanding correct??????

If so please explain to me how the interpreter knows that the -1 in this expression is an int8?
My suspicion is that it thinks it's an int16 and that's why we see the difference!!

I don't know how to pass an int8 of -1 to the interpreter in REPL mode.
Otherwise I'd try that.

============= from Terminal REPL session =============
Gandalf:guile-2.0.7 pteeson$ guile
GNU Guile 2.0.7
<snipped comments>

scheme@(guile-user)> (+ -1 2000 -30000 40000000000)
$1 = 39999971999
scheme@(guile-user)> ,q

which matches the fail message value.
bad return from expression `(f-sum -1 2000 -30000 40000000000)': expected 39999971999; got 39999972255

================= from http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html =========== 
Limits of exact-width integer types
Minimum values of exact-width signed integer types:
{INTN_MIN}
	Exactly -(2 N-1)
Maximum values of exact-width signed integer types:
{INTN_MAX}
	Exactly 2N-1 -1
==========================================



[-- Attachment #2: Type: text/html, Size: 3573 bytes --]

  reply	other threads:[~2013-01-27 21:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-02 20:39 bug#13342: Errors trying to build Guile 2.0.7 Peter Teeson
2013-01-03 15:22 ` Ludovic Courtès
     [not found]   ` <BA2BEFFD-26D7-428B-A455-C7CDC2DB970C@me.com>
2013-01-04  2:18     ` Peter Teeson
2013-01-04  2:21       ` Peter Teeson
2013-01-04 17:23         ` Ludovic Courtès
     [not found]           ` <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com>
2013-01-08 16:08             ` bug#13386: Fwd: " Peter Teeson
2013-01-30 22:13               ` bug#13386: bug#13342: closed (Re: bug#13342: Errors trying to build Guile 2.0.7) , bug#13386: closed (Re: bug#13342: Errors trying to build Guile 2.0.7) Peter Teeson
2013-01-31 20:20                 ` Mark H Weaver
2013-02-01  2:05                   ` bug#13386: " Peter Teeson
2013-02-02 13:11                     ` Mark H Weaver
2013-02-03  0:05                       ` Peter Teeson
2013-02-03  3:22                         ` bug#13386: " Mark H Weaver
2013-01-08 16:08             ` bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 Peter Teeson
2013-01-27 14:11               ` Ludovic Courtès
2013-01-27 21:35                 ` Peter Teeson [this message]
2013-01-28  1:46                 ` Mark H Weaver
2013-01-28  2:40                   ` Peter Teeson
2013-01-28 12:56                   ` Ludovic Courtès
2013-01-28 16:39                     ` Peter Teeson
2013-01-28 16:55                       ` Ludovic Courtès
2013-01-08 16:30 ` bug#13342: Errors trying to build Guile 2.0.7 [PARTIALLY SOLVED] Peter Teeson
2013-01-30  8:34 ` bug#13342: Errors trying to build Guile 2.0.7 Mark H Weaver
2013-01-30 21:37   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='39E86B9E-8939-4F1C-9DFE-2071010E1E70__24038.7997044765$1359322571$gmane$org@me.com' \
    --to=peter.teeson@me.com \
    --cc=13342@debbugs.gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).