1.0.27.4: x86/x86-64 REP prefix has the same code as REPE (not REPNE)
[sbcl.git] / src / compiler / defconstant.lisp
index 5f155eb..1bb1d27 100644 (file)
@@ -24,9 +24,9 @@
   (unless (symbolp name)
     (error "The constant name is not a symbol: ~S" name))
   (when (looks-like-name-of-special-var-p name)
-    (style-warn "defining ~S as a constant, even though the name follows~@
-the usual naming convention (names like *FOO*) for special variables"
-                name))
+    (style-warn 'sb!kernel:asterisks-around-constant-variable-name
+                :format-control "defining ~S as a constant"
+                :format-arguments (list name)))
   (sb!c:with-source-location (source-location)
     (setf (info :source-location :constant name) source-location))
   (let ((kind (info :variable :kind name)))
@@ -99,6 +99,10 @@ the usual naming convention (names like *FOO*) for special variables"
       ;; doubt such warnings are ANSI-compliant, but I'm not sure, so I've
       ;; written this in a way that CMU CL will tolerate and which ought to
       ;; work elsewhere too.) -- WHN 2001-03-24
-      (eval `(defconstant ,name ',value))))
+      (eval `(defconstant ,name ',value)))
+    ;; It would certainly be awesome if this was only needed for symbols
+    ;; in CL. Unfortunately, that is not the case. Maybe some are moved
+    ;; back in CL later on?
+    (setf (info :variable :xc-constant-value name) value))
   (setf (info :variable :kind name) :constant)
   name)