cmp: add explicit type suffixes for emitted integer constants in C code
According to the C99 standard, compilers are supposed to automatically choose the correct type. However, for the C89 standard explicit suffixes are needed for long longs. Guess what standard msvc follows...
This commit is contained in:
parent
f776bd8615
commit
1aeb7823e8
1 changed files with 12 additions and 1 deletions
|
|
@ -19,7 +19,18 @@
|
|||
(defun wt1 (form)
|
||||
(cond ((not (floatp form))
|
||||
(typecase form
|
||||
((or STRING INTEGER CHARACTER)
|
||||
(INTEGER
|
||||
(princ form *compiler-output1*)
|
||||
(princ
|
||||
(cond ((typep form (rep-type->lisp-type :int)) "")
|
||||
((typep form (rep-type->lisp-type :unsigned-int)) "U")
|
||||
((typep form (rep-type->lisp-type :long)) "L")
|
||||
((typep form (rep-type->lisp-type :unsigned-long)) "UL")
|
||||
((typep form (rep-type->lisp-type :long-long)) "LL")
|
||||
((typep form (rep-type->lisp-type :unsigned-long-long)) "ULL")
|
||||
(t (baboon :format-control "wt1: The number ~A doesn't fit any integer type." form)))
|
||||
*compiler-output1*))
|
||||
((or STRING CHARACTER)
|
||||
(princ form *compiler-output1*))
|
||||
(VAR (wt-var form))
|
||||
(t (wt-loc form))))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue