manual: add explanation that inlined functions are compiled with optimization settings of the call site

Bug #457044 reported by Tobias C. Rittweiler
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Confirmed
Low
Unassigned

Bug Description

Inlined functions are compiled relatively to the optimizations settings on the call
site rather than definition site as one might expect.

  (declaim (inline foo))
  (defun foo (x y)
    (+ x y))

  (defun bar (a b)
    (declare (optimize speed))
    (foo a b))

JSnell explained that this is done deliberately so because it's just too damn convenient
in most cases.

I think the behaviour warrants explicit documentation in the manual, though.

Changed in sbcl:
status: New → Confirmed
tags: added: documentation easy
Changed in sbcl:
importance: Undecided → Low
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.