DEFCFUN and unsigned-long-long behaving badly on 64-bit Allegro CL
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CFFI |
Triaged
|
Medium
|
Luís Oliveira |
Bug Description
Bug report sent to Franz.
(in-package :cl-user)
#||
#include <limits.h>
unsigned long long ullong(unsigned long long n)
{
printf(
return n == ULLONG_MAX ? n : 42;
}
||#
(ff:def-
((n :unsigned-nat (unsigned-byte 64)))
:returning (:unsigned-nat (unsigned-byte 64))
:call-direct t ; setting this to nil fixes the symptoms.
:arg-checking nil
:strings-convert nil)
(defun test-ullong ()
(ullong (1- (expt 2 64))))
;; CL-USER> (ullong (1- (expt 2 64)))
;; ullong(
;; 184467440737095
;;
;; But when :call-direct kicks in:
;; CL-USER> (test-ullong)
;; ullong(
;; -1 ; but return value is wrong
tags: | added: allegro implementation-bug |
description: | updated |
Changed in cffi: | |
importance: | Undecided → Medium |
status: | New → Triaged |
assignee: | nobody → Luís Oliveira (luismbo) |