[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] [PATCH] use consistent naming for allocating unsaf
From: |
Peter Bex |
Subject: |
Re: [Chicken-hackers] [PATCH] use consistent naming for allocating unsafe SRFI-4 accessors |
Date: |
Fri, 24 Feb 2012 10:08:01 +0100 |
User-agent: |
Mutt/1.4.2.3i |
On Thu, Feb 23, 2012 at 09:26:43PM +0100, Peter Bex wrote:
> The attached patches might be a good start. Try compiling the following
> "program" after applying both [patches]:
>
> (foreign-declare
> "void blabla1(void) { ___byte_vector x; printf(\"%s\\n\", x); }\n"
> "void blabla2(C_word foo) { C_hash_string(foo); }")
>
> (u32vector-ref (u32vector 1 2 3) 0)
> (s32vector-ref (s32vector 1 2 3) 0)
> (f32vector-ref (f32vector 1.0 2.0 3.0) 0)
> (f64vector-ref (f64vector 1.0 2.0 3.0) 0)
>
> When I do that and compile (with -O4), I get the following messages:
>
> test.c: In function 'blabla1':
> test.c:13: warning: 'x' is deprecated (declared at test.c:13)
> test.c: In function 'blabla2':
> test.c:15: warning: 'C_hash_string' is deprecated (declared at
> /home/sjamaan/chicken-test/include/chicken/chicken.h:1632)
> test.c: In function 'f_213':
> test.c:129: warning: 'C_a_i_u32vector_ref' is deprecated (declared at
> /home/sjamaan/chicken-test/include/chicken/chicken.h:2857)
> test.c: In function 'f_209':
> test.c:145: warning: 'C_a_i_s32vector_ref' is deprecated (declared at
> /home/sjamaan/chicken-test/include/chicken/chicken.h:2861)
> test.c: In function 'f_205':
> test.c:161: warning: 'C_a_i_f32vector_ref' is deprecated (declared at
> /home/sjamaan/chicken-test/include/chicken/chicken.h:2865)
> test.c: In function 'f_201':
> test.c:178: warning: 'C_a_i_f64vector_ref' is deprecated (declared at
> /home/sjamaan/chicken-test/include/chicken/chicken.h:2869)
Of course this only happens if you apply the patches and _only_ install
the new chicken.h file. If you install the complete system these
accessors are rewritten to the new non-deprecated versions.
Cheers,
Peter
--
http://sjamaan.ath.cx
--
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth