chicken-janitors
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-janitors] #1626: +inf.0 inserted literally into C code in some


From: Chicken Trac
Subject: [Chicken-janitors] #1626: +inf.0 inserted literally into C code in some situations with -O3 and above
Date: Thu, 27 Jun 2019 02:20:40 -0000

#1626: +inf.0 inserted literally into C code in some situations with -O3 and 
above
----------------------+--------------------------------
 Reporter:  dieggsy   |                 Owner:
     Type:  defect    |                Status:  new
 Priority:  major     |             Milestone:  someday
Component:  compiler  |               Version:  5.1.0
 Keywords:            |  Estimated difficulty:
----------------------+--------------------------------
 For example, the following code doesn't compile due to this:

 {{{
 (import chicken.flonum)

 (define x 5.0)
 (cond [(fp= x +inf.0)
        (fpabs x)]
       [else (print "Nothing")])
 }}}
 With the first few errors being:
 {{{
 test.c:110:74: error: ‘inf’ undeclared (first use in this function); did
 you mean ‘ynf’?
   110 |
 
if(C_truep(C_ub_i_flonum_equalp(C_flonum_magnitude(*((C_word*)lf[0]+1)),+inf.0))){
       |
 ^~~
 /usr/include/chicken/chicken.h:1035:38: note: in definition of macro
 ‘C_truep’
  1035 | #define C_truep(x)                 ((x) != C_SCHEME_FALSE)
       |                                      ^
 }}}

 Weirdly enough, if I replace {{{fpabs}}} with {{{print}}}, the compilation
 goes fine.

--
Ticket URL: <https://bugs.call-cc.org/ticket/1626>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]