cosmetic: fix some compiler warnings

This commit is contained in:
Marius Gerbershagen 2020-04-26 18:45:40 +02:00
parent bae7d696a9
commit c6b4296bb8
46 changed files with 94 additions and 66 deletions

View file

@ -81,7 +81,7 @@
(defun bc-compile-file-pathname (name &key (output-file name) (type :fasl) (defun bc-compile-file-pathname (name &key (output-file name) (type :fasl)
verbose print c-file h-file data-file verbose print c-file h-file data-file
shared-data-file system-p load external-format) shared-data-file system-p load external-format)
(declare (ignore load c-file h-file data-file shared-data-file system-p verbose print)) (declare (ignore load c-file h-file data-file shared-data-file system-p verbose print external-format))
(let ((extension "fasc")) (let ((extension "fasc"))
(case type (case type
((:fasl :fas) (setf extension "fasc")) ((:fasl :fas) (setf extension "fasc"))

View file

@ -191,11 +191,13 @@ static struct ecl_type_information {
size_t t; size_t t;
} type_info[t_end]; } type_info[t_end];
#ifdef GBC_BOEHM_PRECISE
static void static void
error_wrong_tag(cl_type t) error_wrong_tag(cl_type t)
{ {
ecl_internal_error("Collector called with invalid tag number."); ecl_internal_error("Collector called with invalid tag number.");
} }
#endif
cl_index cl_index
ecl_object_byte_size(cl_type t) ecl_object_byte_size(cl_type t)
@ -764,6 +766,7 @@ extern void (*GC_push_other_roots)();
static void (*old_GC_push_other_roots)(); static void (*old_GC_push_other_roots)();
static void stacks_scanner(); static void stacks_scanner();
#ifdef GBC_BOEHM_PRECISE
static cl_index static cl_index
to_bitmap(void *x, void *y) to_bitmap(void *x, void *y)
{ {
@ -773,6 +776,7 @@ to_bitmap(void *x, void *y)
n /= sizeof(void*); n /= sizeof(void*);
return 1 << n; return 1 << n;
} }
#endif
void void
init_alloc(void) init_alloc(void)

View file

@ -36,6 +36,7 @@ empty_cache(ecl_cache_ptr cache)
#endif #endif
} }
#ifndef ECL_THREADS
static void static void
clear_one_from_cache(ecl_cache_ptr cache, cl_object target) clear_one_from_cache(ecl_cache_ptr cache, cl_object target)
{ {
@ -51,8 +52,7 @@ clear_one_from_cache(ecl_cache_ptr cache, cl_object target)
} }
} }
} }
#else
#ifdef ECL_THREADS
static void static void
clear_list_from_cache(ecl_cache_ptr cache) clear_list_from_cache(ecl_cache_ptr cache)
{ {

View file

@ -847,7 +847,7 @@ c_block(cl_env_ptr env, cl_object body, int old_flags) {
struct cl_compiler_env old_env; struct cl_compiler_env old_env;
cl_object name = pop(&body); cl_object name = pop(&body);
cl_object block_record; cl_object block_record;
cl_index labelz, pc, loc, constants; cl_index labelz, pc, constants;
int flags; int flags;
if (!ECL_SYMBOLP(name)) if (!ECL_SYMBOLP(name))
@ -858,7 +858,7 @@ c_block(cl_env_ptr env, cl_object body, int old_flags) {
pc = current_pc(env); pc = current_pc(env);
flags = maybe_values_or_reg0(old_flags); flags = maybe_values_or_reg0(old_flags);
loc = c_register_block(env, name); c_register_block(env, name);
block_record = ECL_CONS_CAR(env->c_env->variables); block_record = ECL_CONS_CAR(env->c_env->variables);
if (Null(name)) { if (Null(name)) {
asm_op(env, OP_DO); asm_op(env, OP_DO);
@ -1063,7 +1063,7 @@ c_case(cl_env_ptr env, cl_object clause, int flags) {
static int static int
c_catch(cl_env_ptr env, cl_object args, int flags) { c_catch(cl_env_ptr env, cl_object args, int flags) {
cl_index labelz, loc; cl_index labelz;
cl_object old_env; cl_object old_env;
/* Compile evaluation of tag */ /* Compile evaluation of tag */
@ -1071,7 +1071,7 @@ c_catch(cl_env_ptr env, cl_object args, int flags) {
/* Compile binding of tag */ /* Compile binding of tag */
old_env = env->c_env->variables; old_env = env->c_env->variables;
loc = c_register_block(env, ecl_make_fixnum(0)); c_register_block(env, ecl_make_fixnum(0));
asm_op(env, OP_CATCH); asm_op(env, OP_CATCH);
/* Compile jump point */ /* Compile jump point */
@ -3039,7 +3039,7 @@ c_default(cl_env_ptr env, cl_object var, cl_object stmt, cl_object flag, cl_obje
cl_object cl_object
ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) { ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) {
cl_object reqs, opts, rest, key, keys, auxs, allow_other_keys; cl_object reqs, opts, rest, key, keys, auxs, allow_other_keys;
cl_object specials, doc, decl, body, output; cl_object specials, decl, body, output;
cl_index handle; cl_index handle;
struct cl_compiler_env *old_c_env, new_c_env; struct cl_compiler_env *old_c_env, new_c_env;
@ -3057,7 +3057,7 @@ ecl_make_lambda(cl_env_ptr env, cl_object name, cl_object lambda) {
keys = env->values[4]; keys = env->values[4];
allow_other_keys = env->values[5]; allow_other_keys = env->values[5];
auxs = env->values[6]; auxs = env->values[6];
doc = env->values[7]; /* doc = env->values[7]; unused */;
specials = env->values[8]; specials = env->values[8];
decl = env->values[9]; decl = env->values[9];
body = env->values[10]; body = env->values[10];

View file

@ -53,13 +53,11 @@ print_oparg_arg(const char *s, cl_fixnum n, cl_object x) {
static void static void
disassemble_lambda(cl_object bytecodes) { disassemble_lambda(cl_object bytecodes) {
const cl_env_ptr env = ecl_process_env(); const cl_env_ptr env = ecl_process_env();
cl_object *data;
cl_opcode *vector; cl_opcode *vector;
ecl_bds_bind(env, @'*print-pretty*', ECL_NIL); ecl_bds_bind(env, @'*print-pretty*', ECL_NIL);
/* Print required arguments */ /* Print required arguments */
data = bytecodes->bytecodes.data->vector.self.t;
cl_print(1,bytecodes->bytecodes.data); cl_print(1,bytecodes->bytecodes.data);
/* Name of LAMBDA */ /* Name of LAMBDA */

View file

@ -53,7 +53,7 @@
@':element-type', element_type, @':element-type', element_type,
@':if-exists', if_exists, @':if-exists', if_exists,
@':if-does-not-exist', if_does_not_exist, @':if-does-not-exist', if_does_not_exist,
@':external-format', @':default', @':external-format', external_format,
@':cstream', ECL_NIL); @':cstream', ECL_NIL);
fd = ecl_to_int(si_file_stream_fd(stream)); fd = ecl_to_int(si_file_stream_fd(stream));
if (Null(length)) if (Null(length))

View file

@ -314,7 +314,6 @@ ecl_interpret(cl_object frame, cl_object env, cl_object bytecodes)
frame_aux.stack = frame_aux.base = 0; frame_aux.stack = frame_aux.base = 0;
frame_aux.size = 0; frame_aux.size = 0;
frame_aux.env = the_env; frame_aux.env = the_env;
BEGIN:
BEGIN_SWITCH { BEGIN_SWITCH {
CASE(OP_NOP); { CASE(OP_NOP); {
reg0 = ECL_NIL; reg0 = ECL_NIL;

View file

@ -611,7 +611,7 @@ si_complex_float(cl_object r, cl_object i)
{ {
cl_type tr = ecl_t_of(r); cl_type tr = ecl_t_of(r);
cl_type ti = ecl_t_of(i); cl_type ti = ecl_t_of(i);
cl_object result; cl_object result = OBJNULL;
switch (tr) { switch (tr) {
case t_singlefloat: case t_singlefloat:
if (ti != tr) { ecl_type_error(@'si::complex-float',"imag part", i, @'single-float'); } if (ti != tr) { ecl_type_error(@'si::complex-float',"imag part", i, @'single-float'); }

View file

@ -36,7 +36,6 @@
int int
ecl_number_equalp(cl_object x, cl_object y) ecl_number_equalp(cl_object x, cl_object y)
{ {
double dx;
/* INV: (= fixnum bignum) => 0 */ /* INV: (= fixnum bignum) => 0 */
/* INV: (= fixnum ratio) => 0 */ /* INV: (= fixnum ratio) => 0 */
/* INV: (= bignum ratio) => 0 */ /* INV: (= bignum ratio) => 0 */

View file

@ -659,7 +659,9 @@ ecl_parse_namestring(cl_object s, cl_index start, cl_index end, cl_index *ep,
if (!ecl_stringp(device)) { if (!ecl_stringp(device)) {
return ECL_NIL; return ECL_NIL;
} }
#if defined(ECL_MS_WINDOWS_HOST)
maybe_parse_host: maybe_parse_host:
#endif
/* Files have no effective device. */ /* Files have no effective device. */
if (@string-equal(2, device, @':file') == ECL_T) if (@string-equal(2, device, @':file') == ECL_T)
device = ECL_NIL; device = ECL_NIL;

View file

@ -161,10 +161,8 @@ generate(cl_object digits, float_approx *approx)
static void static void
change_precision(float_approx *approx, cl_object position, cl_object relativep) change_precision(float_approx *approx, cl_object position, cl_object relativep)
{ {
cl_fixnum pos;
if (Null(position)) if (Null(position))
return; return;
pos = ecl_fixnum(position);
if (!Null(relativep)) { if (!Null(relativep)) {
cl_object k = ecl_make_fixnum(0); cl_object k = ecl_make_fixnum(0);
cl_object l = ecl_make_fixnum(1); cl_object l = ecl_make_fixnum(1);

View file

@ -102,13 +102,15 @@ needs_to_be_escaped(cl_object s, cl_object readtable, cl_object print_case)
return 0; return 0;
} }
#define buffer_write_char(c, buffer, stream, buffer_ndx, buffer_size) \ static inline void
ecl_char_set(buffer, buffer_ndx++, c); \ buffer_write_char(char c, cl_object buffer, cl_object stream, cl_index *buffer_ndx, cl_index buffer_size) {
if (buffer_ndx >= buffer_size) { \ ecl_char_set(buffer, (*buffer_ndx)++, c);
si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_size)); \ if (*buffer_ndx >= buffer_size) {
si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL);\ si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_size));
buffer_ndx = 0; \ si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL);
*buffer_ndx = 0;
} }
}
static void static void
write_symbol_string(cl_object s, int action, cl_object print_case, write_symbol_string(cl_object s, int action, cl_object print_case,
@ -124,13 +126,13 @@ write_symbol_string(cl_object s, int action, cl_object print_case,
cl_index buffer_size = ecl_fixnum(cl_array_total_size(buffer)); cl_index buffer_size = ecl_fixnum(cl_array_total_size(buffer));
cl_index buffer_ndx = 0; cl_index buffer_ndx = 0;
if (escape) if (escape)
buffer_write_char('|', buffer, stream, buffer_ndx, buffer_size); buffer_write_char('|', buffer, stream, &buffer_ndx, buffer_size);
capitalize = 1; capitalize = 1;
for (i = 0; i < s->base_string.fillp; i++) { for (i = 0; i < s->base_string.fillp; i++) {
ecl_character c = ecl_char(s, i); ecl_character c = ecl_char(s, i);
if (escape) { if (escape) {
if (c == '|' || c == '\\') { if (c == '|' || c == '\\') {
buffer_write_char('\\', buffer, stream, buffer_ndx, buffer_size); buffer_write_char('\\', buffer, stream, &buffer_ndx, buffer_size);
} }
} else if (action != ecl_case_preserve) { } else if (action != ecl_case_preserve) {
if (ecl_upper_case_p(c)) { if (ecl_upper_case_p(c)) {
@ -155,10 +157,10 @@ write_symbol_string(cl_object s, int action, cl_object print_case,
capitalize = !ecl_alphanumericp(c); capitalize = !ecl_alphanumericp(c);
} }
} }
buffer_write_char(c, buffer, stream, buffer_ndx, buffer_size); buffer_write_char(c, buffer, stream, &buffer_ndx, buffer_size);
} }
if (escape) if (escape)
buffer_write_char('|', buffer, stream, buffer_ndx, buffer_size); buffer_write_char('|', buffer, stream, &buffer_ndx, buffer_size);
si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_ndx)); si_fill_pointer_set(buffer, ecl_make_fixnum(buffer_ndx));
si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL); si_do_write_sequence(buffer, stream, ecl_make_fixnum(0), ECL_NIL);
si_put_buffer_string(buffer); si_put_buffer_string(buffer);

View file

@ -120,7 +120,7 @@ write_float(cl_object f, cl_object stream)
static void /* XXX: do not cons new floats here! */ static void /* XXX: do not cons new floats here! */
write_complex_float(cl_object f, cl_object stream) write_complex_float(cl_object f, cl_object stream)
{ {
cl_object real, imag; cl_object real = OBJNULL, imag = OBJNULL;
switch (ecl_t_of(f)) { switch (ecl_t_of(f)) {
case t_csfloat: case t_csfloat:
real = ecl_make_single_float(crealf(ecl_csfloat(f))); real = ecl_make_single_float(crealf(ecl_csfloat(f)));

View file

@ -189,7 +189,7 @@ ecl_copy_seq(cl_object sequence)
return ecl_subseq(sequence, 0, MOST_POSITIVE_FIXNUM); return ecl_subseq(sequence, 0, MOST_POSITIVE_FIXNUM);
} }
@(defun subseq (sequence start &optional end &aux x) @(defun subseq (sequence start &optional end)
cl_index_pair p; cl_index_pair p;
@ @
p = ecl_sequence_start_end(@[subseq], sequence, start, end); p = ecl_sequence_start_end(@[subseq], sequence, start, end);

View file

@ -84,6 +84,7 @@ wait_queue_delete(cl_env_ptr the_env, cl_object q, cl_object item)
* THREAD SCHEDULER & WAITING * THREAD SCHEDULER & WAITING
*/ */
#if !defined(HAVE_SIGPROCMASK)
static cl_object static cl_object
bignum_set_time(cl_object bignum, struct ecl_timeval *time) bignum_set_time(cl_object bignum, struct ecl_timeval *time)
{ {
@ -194,6 +195,7 @@ ecl_wait_on_timed(cl_env_ptr env, cl_object (*condition)(cl_env_ptr, cl_object),
ecl_bds_unwind1(the_env); ecl_bds_unwind1(the_env);
return output; return output;
} }
#endif
/********************************************************************** /**********************************************************************
* BLOCKING WAIT QUEUE ALGORITHM * BLOCKING WAIT QUEUE ALGORITHM

View file

@ -351,7 +351,7 @@ file_truename(cl_object pathname, cl_object filename, int flags)
* the other hand, if the link is broken return file * the other hand, if the link is broken return file
* truename "as is". */ * truename "as is". */
struct stat filestatus; struct stat filestatus;
if (safe_stat(filename->base_string.self, &filestatus) < 0) { if (safe_stat((char*) filename->base_string.self, &filestatus) < 0) {
@(return pathname kind); @(return pathname kind);
} }
filename = si_readlink(filename); filename = si_readlink(filename);
@ -560,7 +560,9 @@ ecl_file_len(int f)
} }
#endif #endif
} }
#if defined(ECL_MS_WINDOWS_HOST)
FAILURE_CLOBBER: FAILURE_CLOBBER:
#endif
ecl_enable_interrupts(); ecl_enable_interrupts();
{ {
cl_object c_error = _ecl_strerror(errno); cl_object c_error = _ecl_strerror(errno);

View file

@ -211,6 +211,7 @@
o)) o))
(defun find-method-combination (gf method-combination-type-name method-combination-options) (defun find-method-combination (gf method-combination-type-name method-combination-options)
(declare (ignore gf))
(make-method-combination method-combination-type-name (make-method-combination method-combination-type-name
(search-method-combination method-combination-type-name) (search-method-combination method-combination-type-name)
method-combination-options method-combination-options

View file

@ -181,7 +181,7 @@
(defmethod shared-initialize ((gfun standard-generic-function) slot-names (defmethod shared-initialize ((gfun standard-generic-function) slot-names
&rest initargs) &rest initargs)
(declare (ignore initargs slot-names)) (declare (ignore slot-names))
(call-next-method) (call-next-method)
(when (generic-function-methods gfun) (when (generic-function-methods gfun)
(compute-g-f-spec-list gfun)) (compute-g-f-spec-list gfun))

View file

@ -355,7 +355,7 @@
(with-early-accessors (+standard-generic-function-slots+ (with-early-accessors (+standard-generic-function-slots+
+eql-specializer-slots+ +eql-specializer-slots+
+standard-method-slots+) +standard-method-slots+)
(flet ((nupdate-spec-how-list (spec-how-list specializers gf) (flet ((nupdate-spec-how-list (spec-how-list specializers)
;; update the spec-how of the gfun ;; update the spec-how of the gfun
;; computing the or of the previous value and the new one ;; computing the or of the previous value and the new one
(setf spec-how-list (or spec-how-list (setf spec-how-list (or spec-how-list
@ -379,7 +379,7 @@
(a-p-o (generic-function-argument-precedence-order gf))) (a-p-o (generic-function-argument-precedence-order gf)))
(dolist (method (generic-function-methods gf)) (dolist (method (generic-function-methods gf))
(setf spec-how-list (setf spec-how-list
(nupdate-spec-how-list spec-how-list (method-specializers method) gf))) (nupdate-spec-how-list spec-how-list (method-specializers method))))
(setf (generic-function-spec-list gf) (setf (generic-function-spec-list gf)
(loop for type in spec-how-list (loop for type in spec-how-list
for i from 0 for i from 0

View file

@ -102,6 +102,7 @@
(when (eq (first method-lambda) 'lambda) (when (eq (first method-lambda) 'lambda)
(multiple-value-bind (declarations body documentation) (multiple-value-bind (declarations body documentation)
(si::find-declarations (cddr method-lambda)) (si::find-declarations (cddr method-lambda))
(declare (ignore documentation))
(let (block) (let (block)
(when (and (null (rest body)) (when (and (null (rest body))
(listp (setf block (first body))) (listp (setf block (first body)))
@ -177,6 +178,7 @@
(values method-lambda declarations documentation)))) (values method-lambda declarations documentation))))
(defun make-method-lambda (gf method method-lambda env) (defun make-method-lambda (gf method method-lambda env)
(declare (ignore method gf))
(multiple-value-bind (call-next-method-p next-method-p-p in-closure-p) (multiple-value-bind (call-next-method-p next-method-p-p in-closure-p)
(walk-method-lambda method-lambda env) (walk-method-lambda method-lambda env)
(values `(lambda (.combined-method-args. *next-methods*) (values `(lambda (.combined-method-args. *next-methods*)
@ -190,6 +192,7 @@
(defun add-call-next-method-closure (method-lambda) (defun add-call-next-method-closure (method-lambda)
(multiple-value-bind (declarations real-body documentation) (multiple-value-bind (declarations real-body documentation)
(si::find-declarations (cddr method-lambda)) (si::find-declarations (cddr method-lambda))
(declare (ignore documentation))
`(lambda ,(second method-lambda) `(lambda ,(second method-lambda)
,@declarations ,@declarations
(let* ((.closed-combined-method-args. (let* ((.closed-combined-method-args.

View file

@ -112,12 +112,15 @@
(no-make-load-form object))))) (no-make-load-form object)))))
(defmethod make-load-form ((object standard-object) &optional environment) (defmethod make-load-form ((object standard-object) &optional environment)
(declare (ignore environment))
(no-make-load-form object)) (no-make-load-form object))
(defmethod make-load-form ((object structure-object) &optional environment) (defmethod make-load-form ((object structure-object) &optional environment)
(declare (ignore environment))
(no-make-load-form object)) (no-make-load-form object))
(defmethod make-load-form ((object condition) &optional environment) (defmethod make-load-form ((object condition) &optional environment)
(declare (ignore environment))
(no-make-load-form object)) (no-make-load-form object))
(defun no-make-load-form (object) (defun no-make-load-form (object)

View file

@ -23,6 +23,7 @@
;;; ;;;
(defun safe-slot-definition-location (slotd &optional default) (defun safe-slot-definition-location (slotd &optional default)
(declare (ignore default))
(cond ((listp slotd) (cond ((listp slotd)
(error "List instead of a slot definition object")) (error "List instead of a slot definition object"))
(t (t

View file

@ -130,10 +130,6 @@
:from-lisp from-lisp :from-lisp from-lisp
:from-lisp-unsafe from-lisp-unsafe)))) :from-lisp-unsafe from-lisp-unsafe))))
(defun make-rep-type-hash (all-c-types)
(let ((table (make-hash-table :size 128 :test 'eq)))
table))
(defun default-machine () (defun default-machine ()
(let* ((all-c-types (append +this-machine-c-types+ +all-machines-c-types+)) (let* ((all-c-types (append +this-machine-c-types+ +all-machines-c-types+))
(table (make-hash-table :size 128 :test 'eq)) (table (make-hash-table :size 128 :test 'eq))

View file

@ -36,6 +36,7 @@
env)) env))
(multiple-value-bind (body specials types ignored others doc all) (multiple-value-bind (body specials types ignored others doc all)
(c1body `((DECLARE ,@args)) nil) (c1body `((DECLARE ,@args)) nil)
(declare (ignore body doc all))
(when ignored (when ignored
(cmpwarn-style "IGNORE/IGNORABLE declarations in DECLAIM are ignored")) (cmpwarn-style "IGNORE/IGNORABLE declarations in DECLAIM are ignored"))
(reduce #'add-one-declaration others (reduce #'add-one-declaration others

View file

@ -33,10 +33,10 @@
(defun validate-alien-declaration (names-list error) (defun validate-alien-declaration (names-list error)
(dolist (new-declaration names-list) (dolist (new-declaration names-list)
(unless (symbolp new-declaration) (unless (symbolp new-declaration)
(cmperr "The declaration ~s is not a symbol" new-declaration)) (funcall error "The declaration ~s is not a symbol" new-declaration))
(when (type-name-p new-declaration) (when (type-name-p new-declaration)
(cmperr "Symbol name ~S cannot be both the name of a type and of a declaration" (funcall error "Symbol name ~S cannot be both the name of a type and of a declaration"
new-declaration)))) new-declaration))))
(defun alien-declaration-p (name &optional (env *cmp-env*)) (defun alien-declaration-p (name &optional (env *cmp-env*))
(and (symbolp name) (and (symbolp name)

View file

@ -91,7 +91,7 @@
(values nil nil)))) (values nil nil))))
(defun get-local-return-type (fun &optional (env *cmp-env*)) (defun get-local-return-type (fun &optional (env *cmp-env*))
(let ((x (cmp-env-search-ftype (fun-name fun)))) (let ((x (cmp-env-search-ftype (fun-name fun) env)))
(if x (if x
(values (second x) t) (values (second x) t)
(values nil nil)))) (values nil nil))))

View file

@ -182,7 +182,7 @@
(wt-nl-open-brace) (wt-nl-open-brace)
(incf *inline-blocks*)) (incf *inline-blocks*))
(defun close-inline-blocks (&optional new-line) (defun close-inline-blocks ()
(loop for i of-type fixnum from 0 below *inline-blocks* (loop for i of-type fixnum from 0 below *inline-blocks*
do (wt-nl-close-brace))) do (wt-nl-close-brace)))

View file

@ -335,6 +335,7 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts."
(maxarg call-arguments-limit)) (maxarg call-arguments-limit))
(destructuring-bind (requireds optionals rest key-flag keywords a-o-k) (destructuring-bind (requireds optionals rest key-flag keywords a-o-k)
(c1form-arg 0 lambda) (c1form-arg 0 lambda)
(declare (ignore keywords))
(setf minarg (length requireds)) (setf minarg (length requireds))
(when (and (null rest) (not key-flag) (not a-o-k)) (when (and (null rest) (not key-flag) (not a-o-k))
(setf maxarg (+ minarg (/ (length optionals) 3))))) (setf maxarg (+ minarg (/ (length optionals) 3)))))

View file

@ -311,7 +311,7 @@
(when env (pop-debug-lexical-env)))) (when env (pop-debug-lexical-env))))
(c2expr body)) (c2expr body))
(close-inline-blocks :line)) (close-inline-blocks))
(defun discarded (var form body &aux last) (defun discarded (var form body &aux last)
(labels ((last-form (x &aux (args (c1form-args x))) (labels ((last-form (x &aux (args (c1form-args x)))

View file

@ -218,6 +218,7 @@
;;; ;;;
(defun set-unknown-loc (loc) (defun set-unknown-loc (loc)
(declare (ignore loc))
(unknown-location 'set-loc *destination*)) (unknown-location 'set-loc *destination*))
(defun set-loc (loc &aux fd) (defun set-loc (loc &aux fd)

View file

@ -48,6 +48,8 @@ the environment variable TMPDIR to a different value." template))
verbose print c-file h-file data-file verbose print c-file h-file data-file
system-p load external-format source-truename system-p load external-format source-truename
source-offset) source-offset)
(declare (ignore verbose print c-file h-file data-file load
external-format source-truename source-offset))
(let* ((format '()) (let* ((format '())
(extension '())) (extension '()))
(unless type-supplied-p (unless type-supplied-p
@ -145,6 +147,7 @@ the environment variable TMPDIR to a different value." template))
(defun linker-cc (o-pathname object-files &key (defun linker-cc (o-pathname object-files &key
(type :program) (type :program)
(ld-flags (split-program-options *ld-flags*))) (ld-flags (split-program-options *ld-flags*)))
(declare (ignore type))
(safe-run-program (safe-run-program
*ld* *ld*
`("-o" ,(brief-namestring o-pathname) `("-o" ,(brief-namestring o-pathname)
@ -995,6 +998,7 @@ from the C language code. NIL means \"do not create the file\"."
*safety* *space* *speed* *debug*)) *safety* *space* *speed* *debug*))
(defmacro with-compilation-unit (options &rest body) (defmacro with-compilation-unit (options &rest body)
(declare (ignore options))
`(progn ,@body)) `(progn ,@body))
(ext:package-lock "CL" t) (ext:package-lock "CL" t)

View file

@ -166,7 +166,7 @@
(declare (si::c-local)) (declare (si::c-local))
(if (plusp i) (values-loc i) 'VALUE0)) (if (plusp i) (values-loc i) 'VALUE0))
(defun do-m-v-setq (vars form use-bind &aux min-values max-values) (defun do-m-v-setq (vars form use-bind)
;; This routine moves values from the multiple-value stack into the ;; This routine moves values from the multiple-value stack into the
;; variables VARS. The amount of values is not known (or at least we only ;; variables VARS. The amount of values is not known (or at least we only
;; know that there is some number between MIN-VALUES and MAX-VALUES). If ;; know that there is some number between MIN-VALUES and MAX-VALUES). If

View file

@ -161,7 +161,7 @@ initialization from the C code which wants to use it."
c) c)
(t (t
#\p))) #\p)))
(disambiguation (c) (disambiguation (kind)
(case kind (case kind
((:object :c) "") ((:object :c) "")
((:fasl :fas) "fas_") ((:fasl :fas) "fas_")

View file

@ -254,11 +254,13 @@
(def-type-propagator acos (fname op1-type) (def-type-propagator acos (fname op1-type)
(multiple-value-bind (output-type op1-type) (multiple-value-bind (output-type op1-type)
(ensure-nonrational-type op1-type) (ensure-nonrational-type op1-type)
(declare (ignore output-type))
(values (list op1-type) 'NUMBER))) (values (list op1-type) 'NUMBER)))
(def-type-propagator atan (fname op1-type &optional (op2-type t op2-p)) (def-type-propagator atan (fname op1-type &optional (op2-type t op2-p))
(multiple-value-bind (float-t1 t1) (multiple-value-bind (float-t1 t1)
(ensure-nonrational-type op1-type) (ensure-nonrational-type op1-type)
(declare (ignore float-t1))
(if op2-p (if op2-p
(multiple-value-bind (result t1 t2) (multiple-value-bind (result t1 t2)
(maximum-number-type t1 op2-type :only-real t) (maximum-number-type t1 op2-type :only-real t)

View file

@ -65,19 +65,19 @@
"ecl_princ(#0,#1)" "ecl_princ(#0,#1)"
:one-liner t))) :one-liner t)))
(define-compiler-macro terpri (&optional stream &environment env) (define-compiler-macro terpri (&optional stream)
`(ffi:c-inline (,stream) `(ffi:c-inline (,stream)
(:object) :object (:object) :object
"ecl_terpri(#0)" "ecl_terpri(#0)"
:one-liner t)) :one-liner t))
(define-compiler-macro print (value &optional stream &environment env) (define-compiler-macro print (value &optional stream)
`(ffi:c-inline (,value ,stream) `(ffi:c-inline (,value ,stream)
(:object :object) :object (:object :object) :object
"ecl_print(#0,#1)" "ecl_print(#0,#1)"
:one-liner t)) :one-liner t))
(define-compiler-macro prin1 (value &optional stream &environment env) (define-compiler-macro prin1 (value &optional stream)
`(ffi:c-inline (,value ,stream) `(ffi:c-inline (,value ,stream)
(:object :object) :object (:object :object) :object
"ecl_prin1(#0,#1)" "ecl_prin1(#0,#1)"

View file

@ -220,6 +220,7 @@
(return ,%sublist))))))) (return ,%sublist)))))))
(define-compiler-macro member (&whole whole value list &rest sequence-args) (define-compiler-macro member (&whole whole value list &rest sequence-args)
(declare (value list sequence-args))
(if (policy-inline-sequence-functions) (if (policy-inline-sequence-functions)
(or (apply #'expand-member (rest whole)) (or (apply #'expand-member (rest whole))
whole) whole)
@ -264,6 +265,7 @@
(return ,%elt)))))))))) (return ,%elt))))))))))
(define-compiler-macro assoc (&whole whole value list &rest sequence-args) (define-compiler-macro assoc (&whole whole value list &rest sequence-args)
(declare (ignore value list sequence-args))
(if (policy-inline-sequence-functions) (if (policy-inline-sequence-functions)
(or (apply #'expand-assoc (rest whole)) (or (apply #'expand-assoc (rest whole))
whole) whole)
@ -287,6 +289,7 @@
(return ,%elt)))))))) (return ,%elt))))))))
(define-compiler-macro find (&whole whole value sequence &rest sequence-args) (define-compiler-macro find (&whole whole value sequence &rest sequence-args)
(declare (ignore value sequence sequence-args))
(if (policy-inline-sequence-functions) (if (policy-inline-sequence-functions)
(or (apply #'expand-find (rest whole)) (or (apply #'expand-find (rest whole))
whole) whole)

View file

@ -160,6 +160,7 @@
form)))) form))))
(define-compiler-macro typep (&whole form object type &optional e &environment env) (define-compiler-macro typep (&whole form object type &optional e &environment env)
(declare (ignore e))
(expand-typep form object type env)) (expand-typep form object type env))
;;; ;;;
@ -346,8 +347,7 @@
(multiple-value-bind (constant-p float) (multiple-value-bind (constant-p float)
(constant-value-p float env) (constant-value-p float env)
(when (and constant-p (floatp float)) (when (and constant-p (floatp float))
(let* ((aux (gentemp)) (let* ((float (type-of float))
(float (type-of float))
(c-type (lisp-type->rep-type float))) (c-type (lisp-type->rep-type float)))
`(let ((value ,value)) `(let ((value ,value))
(declare (:read-only value)) (declare (:read-only value))

View file

@ -379,12 +379,14 @@ compute it. This version only handles the simplest cases."
elt-type))) elt-type)))
(def-type-propagator si::row-major-aset (fname array-type index obj) (def-type-propagator si::row-major-aset (fname array-type index obj)
(declare (ignore index obj))
(multiple-value-bind (elt-type array-type) (multiple-value-bind (elt-type array-type)
(type-from-array-elt array-type) (type-from-array-elt array-type)
(values (list array-type 'si::index elt-type) (values (list array-type 'si::index elt-type)
elt-type))) elt-type)))
(def-type-propagator row-major-aref (fname array-type index) (def-type-propagator row-major-aref (fname array-type index)
(declare (ignore index))
(multiple-value-bind (elt-type array-type) (multiple-value-bind (elt-type array-type)
(type-from-array-elt array-type) (type-from-array-elt array-type)
(values (list array-type 'si::index) elt-type))) (values (list array-type 'si::index) elt-type)))

View file

@ -477,6 +477,7 @@
args args
(multiple-value-bind (function pprint doc-string) (multiple-value-bind (function pprint doc-string)
(sys::expand-defmacro name lambda-list body) (sys::expand-defmacro name lambda-list body)
(declare (ignore pprint doc-string))
(let ((fn (cmp-eval function *cmp-env*))) (let ((fn (cmp-eval function *cmp-env*)))
(cmp-env-register-global-macro name fn)) (cmp-env-register-global-macro name fn))
(t1expr* (macroexpand `(DEFMACRO ,@args)))))) (t1expr* (macroexpand `(DEFMACRO ,@args))))))

View file

@ -58,7 +58,7 @@
FEtype_error_sequence(#0);") FEtype_error_sequence(#0);")
(vector . "if (ecl_unlikely(!ECL_VECTORP(#0))) FEtype_error_vector(#0);"))) (vector . "if (ecl_unlikely(!ECL_VECTORP(#0))) FEtype_error_vector(#0);")))
(defun simple-type-assertion (value type env) (defun simple-type-assertion (value type)
(let ((simple-form (cdr (assoc type +simple-type-assertions+)))) (let ((simple-form (cdr (assoc type +simple-type-assertions+))))
(if simple-form (if simple-form
`(ffi:c-inline (,value) (:object) :void ,simple-form `(ffi:c-inline (,value) (:object) :void ,simple-form
@ -82,13 +82,13 @@
(compulsory (compulsory
;; The check has to be produced, independent of the declared ;; The check has to be produced, independent of the declared
;; value of the variable (for instance, in LAMBDA arguments). ;; value of the variable (for instance, in LAMBDA arguments).
(simple-type-assertion value type env)) (simple-type-assertion value type))
(t (t
;; We may rely on the compiler to choose the appropriate ;; We may rely on the compiler to choose the appropriate
;; branch once type propagation has happened. ;; branch once type propagation has happened.
`(ext:compiler-typecase ,value `(ext:compiler-typecase ,value
(,type) (,type)
(t ,(simple-type-assertion value type env)))))) (t ,(simple-type-assertion value type))))))
(defun c1checked-value (args) (defun c1checked-value (args)
(let* ((type (pop args)) (let* ((type (pop args))

View file

@ -74,13 +74,13 @@
(mapcar #'first (var-read-nodes var))) (mapcar #'first (var-read-nodes var)))
(defun assert-var-ref-value (var) (defun assert-var-ref-value (var)
#+debug-compiler (when *debug-compiler*
(unless (let ((ref (var-ref var))) (unless (let ((ref (var-ref var)))
(or (> ref (/ most-positive-fixnum 2)) (or (> ref (/ most-positive-fixnum 2))
(= (var-ref var) (+ (length (var-read-nodes var)) (= (var-ref var) (+ (length (var-read-nodes var))
(length (var-set-nodes var)))))) (length (var-set-nodes var))))))
(baboon :format-control "Number of references in VAR ~A unequal to references list" (baboon :format-control "Number of references in VAR ~A unequal to references list"
:format-arguments (list var)))) :format-arguments (list var)))))
(defun assert-var-not-ignored (var) (defun assert-var-not-ignored (var)
(when (let ((x (var-ignorable var))) (and x (minusp x))) (when (let ((x (var-ignorable var))) (and x (minusp x)))
@ -229,6 +229,7 @@
(defun c1vref (name) (defun c1vref (name)
(multiple-value-bind (var cfb unw) (multiple-value-bind (var cfb unw)
(cmp-env-search-var name) (cmp-env-search-var name)
(declare (ignore unw))
(cond ((null var) (cond ((null var)
(c1make-global-variable name :warn t (c1make-global-variable name :warn t
:type (or (si:get-sysprop name 'CMP-TYPE) t))) :type (or (si:get-sysprop name 'CMP-TYPE) t)))

View file

@ -1189,7 +1189,7 @@
(proclamation si:open-unix-socket-stream (string) stream) (proclamation si:open-unix-socket-stream (string) stream)
#+wants-sockets #+wants-sockets
(proclamation si:lookup-host-entry (t) (values (or null string) list list)) (proclamation si:lookup-host-entry (t) (values (or null string) list list))
(proclamation si:copy-stream (stream stream wait) t) (proclamation si:copy-stream (stream stream gen-bool) t)
(proclamation si:make-encoding (t) hash-table) (proclamation si:make-encoding (t) hash-table)
(proclamation si:load-encoding (t) t) (proclamation si:load-encoding (t) t)

View file

@ -152,6 +152,7 @@ typedef int16_t cl_opcode;
goto *(&&LBL_OP_NOP + offsets[GET_OPCODE(vector)]) goto *(&&LBL_OP_NOP + offsets[GET_OPCODE(vector)])
#else #else
#define BEGIN_SWITCH \ #define BEGIN_SWITCH \
BEGIN: \
switch (GET_OPCODE(vector)) switch (GET_OPCODE(vector))
#define THREAD_NEXT \ #define THREAD_NEXT \
goto BEGIN goto BEGIN

View file

@ -313,10 +313,10 @@
(or (equal old-def new-def) (or (equal old-def new-def)
(destructuring-bind (old-slot-name old-init old-type old-read-only old-offset old-ac) (destructuring-bind (old-slot-name old-init old-type old-read-only old-offset old-ac)
old-def old-def
(declare (ignore old-init old-read-only old-ac)) (declare (ignore old-slot-name old-init old-read-only old-ac))
(destructuring-bind (new-slot-name new-init new-type new-read-only new-offset new-ac) (destructuring-bind (new-slot-name new-init new-type new-read-only new-offset new-ac)
new-def new-def
(declare (ignore new-init new-read-only new-ac)) (declare (ignore new-slot-name new-init new-read-only new-ac))
;; Name EQL is not enforced because structures may be ;; Name EQL is not enforced because structures may be
;; constructed by code generators and it is likely they ;; constructed by code generators and it is likely they
;; will have gensymed names. -- jd 2019-05-22 ;; will have gensymed names. -- jd 2019-05-22

View file

@ -834,7 +834,8 @@ reference the arguments of the function as \"#0\", \"#1\", etc.
The interpreter ignores this form. ARG-TYPES are argument types of The interpreter ignores this form. ARG-TYPES are argument types of
the defined Lisp function and RESULT-TYPE is its return type." the defined Lisp function and RESULT-TYPE is its return type."
(let ((args (mapcar #'(lambda (x) (gensym)) arg-types))) (let ((args (mapcar #'(lambda (x) (declare (ignore x)) (gensym))
arg-types)))
`(defun ,name ,args `(defun ,name ,args
(c-inline ,args ,arg-types ,result-type (c-inline ,args ,arg-types ,result-type
,c-expression :one-liner t)))) ,c-expression :one-liner t))))
@ -850,7 +851,8 @@ FUNCTION-NAME.
The interpreter ignores this form. ARG-TYPES are argument types of The interpreter ignores this form. ARG-TYPES are argument types of
the C function and RESULT-TYPE is its return type." the C function and RESULT-TYPE is its return type."
(let ((output-type :object) (let ((output-type :object)
(args (mapcar #'(lambda (x) (gensym)) arg-types))) (args (mapcar #'(lambda (x) (declare (ignore x)) (gensym))
arg-types)))
(if (consp c-name) (if (consp c-name)
(setf output-type (first c-name) (setf output-type (first c-name)
c-name (second c-name))) c-name (second c-name)))

View file

@ -31,7 +31,6 @@
(push item vars)) (push item vars))
(push item all)) (push item all))
(dotimes (i stores-no) (dotimes (i stores-no)
(declare (ignore i))
(push (gensym) stores)) (push (gensym) stores))
(let* ((all (nreverse all))) (let* ((all (nreverse all)))
(values (nreverse vars) (values (nreverse vars)