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
Subject: bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7
Date: Tue, 08 Jan 2013 11:08:43 -0500	[thread overview]
Message-ID: <7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com> (raw)
In-Reply-To: <895C23AD-DD0D-40FC-AD5F-6CEF52365444@me.com>

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

Hi Ludo:
I think the reason that we get this error is that the "a" argument is declared to be only 8 bits wide
but is passed in as -1 which is correctly represented as 0xFFFFFFFF

However an 8-bit representation is 0xFF which is only 255.

Here is how I tracked it down:
(0) Took the printf's from my test program and placed them in 

scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 b,
                          scm_t_int32 c, scm_t_int64 d);
scm_t_int64 test_ffi_sum (scm_t_int8 a, scm_t_int16 b,
                          scm_t_int32 c, scm_t_int64 d)
{
    scm_t_int64 sum;
    printf("scm_t_int64 d %" "ll" "d" " %#llX \n", d,d);
    printf("scm_t_int32 c %" "d" " %#X \n", c,c);
    printf("scm_t_int16 b %" "hd" " %#X \n", b,b);
    printf("scm_t_int8 a %" "hh" "d" " %#X \n", a,a);
    sum = d + c + b + a;
    printf("scm_t_int64 sum %" "ll" "d" " %#llX \n", sum,sum);

    a = -1; //  NOTE:re-assign of a!!!!
    printf("scm_t_int16 a %" "hd" " %#X \n", a,a);

    return d + c + b + a;
}

(1) Did make and make check with the following result

scm_t_int64 d 40000000000 0X9502F9000 
scm_t_int32 c -30000 0XFFFF8AD0 
scm_t_int16 b 2000 0X7D0 
scm_t_int8 a -1 0XFF 
scm_t_int64 sum 39999972255 0X9502F239F 
scm_t_int16 a -1 0XFFFFFFFF 
PASS: test-ffi


(2) Observe that the test passed. 
So I think my original suspicion seems to have been confirmed.

I do not know where to go from here but await your further instructions.

respect

Peter

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

  parent reply	other threads:[~2013-01-08 16:08 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             ` Peter Teeson [this message]
2013-01-27 14:11               ` bug#13342: [PARTIALLY SOLVED] bug#13342: Errors trying to build Guile 2.0.7 Ludovic Courtès
2013-01-27 21:35                 ` Peter Teeson
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=7C7443E9-9DA7-493D-8321-F5859170BAB5@me.com \
    --to=peter.teeson@me.com \
    --cc=13342@debbugs.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).