bugGNU Common Lisp - Bugs: bug #65440, gcl, mformat and *error-output*


bug #65440: gcl, mformat and *error-output*

Submitter:  Leo Butler <l_butler>
Submitted:  Sat 09 Mar 2024 07:32:10 PM UTC
Category:  None Severity:  3 - Normal
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup

Sat 09 Mar 2024 07:32:10 PM UTC, original submission:  

From: Leo Butler <Leo.Butler@umanitoba.ca>
Subject: [Maxima-discuss] gcl, mformat and error-output
To: maxima-discuss <maxima-discuss@lists.sourceforge.net>
Date: Thu, 7 Mar 2024 21:03:14 +0000 (1 day, 22 hours, 25 minutes ago)

I am trying to figure out what is causing a vexing bug involving GCL,

Consider a stripped-down definition of MY-ERROR-FN:

MAXIMA> (defun my-error-fn (sstring &rest l)
(let ((standard-output *error-output*))
           (mformat t "~a" sstring)
   (fresh-line standard-output)))

The return value of MY-ERROR-FN is T if FRESH-LINE prints a newline and
NIL if not.

Here it is with the default value of ERROR-OUTPUT:

MAXIMA> (my-error-fn "An error occurred.")
An error occurred.

That is a bug, FRESH-LINE should have inserted a newline. What is weird
is that if MFORMAT is replaced by FORMAT, then FRESH-LINE works as
expected. I cannot figure out what MFORMAT is doing that tickles this
bug. Note that this is specific to GCL (tested with v2.6.14).

Here are two good cases, where FRESH-LINE works correctly.

MAXIMA> (setf error-output *standard-output* )

#<synonym stream to TERMINAL-IO>

MAXIMA> (my-error-fn "An error occurred.")
An error occurred.

MAXIMA> (setf error-output (make-string-output-stream ))

#<string-output stream 000000000257bc18>
MAXIMA> (my-error-fn "An error occurred.")

MAXIMA> (get-output-stream-string error-output)

"An error occurred.


Leo Butler <l_butler>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by l_butler (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.


    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-6ae7.
    Corresponding source code