[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] incorrect warning during compilation
From: |
Felix Winkelmann |
Subject: |
Re: [Chicken-hackers] incorrect warning during compilation |
Date: |
Wed, 25 Jun 2014 15:50:21 +0200 (CEST) |
> I think I may have found a tiny bug in core. So instead of going on IRC and
> crying to Peter, I though I'd try it myself this time. I have a file like
> this:
>
> (print ((foreign-lambda* c-string ((blob x)) "x[0] = 65; return(x);")
> "xBC"))
>
> When I run this, everything works:
> $ ./type-test
> ABC
>
> However, I see a warning during compilation which I do not expect:
>
> $ csc type-test.scm
>
> Warning: at toplevel:
> (type-test.scm:2) in procedure call to `g01', expected argument #1 of
> type `(or boolean blob)', but was given an argument of type `string'
>
You specify "blob" as foreign type but pass a string as the
argument. That the generated code works is just a coincedence - blobs
and strings have the same internal representation. You can use
"string->blob" to convert the argument to a blob object.
felix
- [Chicken-hackers] incorrect warning during compilation, Kristian Lein-Mathisen, 2014/06/24
- Re: [Chicken-hackers] incorrect warning during compilation,
Felix Winkelmann <=
- Re: [Chicken-hackers] incorrect warning during compilation, Kristian Lein-Mathisen, 2014/06/25
- Re: [Chicken-hackers] incorrect warning during compilation, Felix Winkelmann, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Kristian Lein-Mathisen, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Felix Winkelmann, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Kristian Lein-Mathisen, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Jörg F. Wittenberger, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Felix Winkelmann, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, John Cowan, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Moritz Heidkamp, 2014/06/27
- Re: [Chicken-hackers] incorrect warning during compilation, Felix Winkelmann, 2014/06/27