Inconsistent prioritization of SB-EXT:RESTRICT-COMPILER-POLICY over PROCLAIM, DECLAIM, and DECLARE forms by platform
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
SBCL |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
## Description
This bug was discovered as part of fixing a seemingly unrelated type-declaration based issue for the CL-ISAAC library, when a user had set SB-EXT:
According to my understanding of compiler-policy restrictions, the Linux and Windows behaviour is correct while the macOS behaviour is incorrect. However, the behaviour should be consistent across platforms.
## Test Case
- Add `(SB-EXT:
- Define a function that declares safety 0, but which would otherwise break this policy, such as:
```lisp
(defun policy-test ()
(declare (optimize (safety 0)))
(the integer nil))
```
- And compile
On macOS with SBCL 2.3.4, this will compile without error.
On Linux and Windows this will not compile, explicitly ignoring the local declaration of safety 0.
## Technical Info
My principal dev environment, to which this applies:
sbcl --version =>
SBCL 2.3.4
uname -a =>
Darwin BlackLotusAlpha
*FEATURES* =>
(:QUICKLISP :ASDF3.3 :ASDF3.2 :ASDF3.1 :ASDF3 :ASDF2 :ASDF :OS-MACOSX :OS-UNIX
:NON-BASE-
:ANSI-CL :BSD :COMMON-LISP :DARWIN :IEEE-FLOATING-
:PACKAGE-
:SB-THREAD :SB-UNICODE :SBCL :UNIX)
## Additional Notes
Homebrew and Scoop releases are several versions behind, so I'm aware I'm not testing against the latest releases.
Compile-time type conflicts are detected irrespective of SAFETY. So I have no idea what you are describing.