[cl-plus-ssl-devel] DECLAIM forms in cl+ssl messes up my compiler settings

Chaitanya Gupta mail at chaitanyagupta.com
Thu Sep 13 21:11:56 UTC 2007


Hello,

The files ffi.lisp and streams.lisp in cl+ssl contain the following
declaim statement -

(declaim
 (optimize (speed 3) (space 1) (safety 1) (debug 0) (compilation-speed 0)))

Is there any specific reason why they are there? This is causing
problems for me since DECLAIM sets my compiler's global optimization
settings to this value when these files are "loaded" [1]. Personally, I
would prefer not to see any library decide for me what optimization
settings "it" should compile with, but if we have to do it, can we
atleast wrap this form inside an eval-when?

(eval-when (:compile-toplevel)
  (declaim
   (optimize (speed 3) (space 1) (safety 1) (debug 0) (compilation-speed
0))))


This doesn't guarantee the problem is solved in all cases, but if the
Lisp implementation does not persist compile-time effects after the file
has been compiled, atleast it will solve it for those. To be more specific,
- this will solve this problem for ACL 8.0
- for SBCL, this problem never occurs in the first place [2]

Still, my personal choice would be to not have any declaim statements in
the files. I should be able to decide what optimization settings a
library should compile with on my machine - unless there is a compelling
reason for the library to make this decision.

Thanks,

Chaitanya


1. See KMP's recent post on this -
http://groups.google.com/group/comp.lang.lisp/msg/da2af1dde2605aa6
2. Juho Snellman's explaination on how SBCL does it (in the same thread
as 1.) - http://groups.google.com/group/comp.lang.lisp/msg/7beac4c29bbd2d33



More information about the cl-plus-ssl-devel mailing list