From: "Eregon (Benoit Daloze)" <noreply@...>
Date: 2022-11-25T16:24:44+00:00
Subject: [ruby-core:111010] [Ruby master Bug#19150] pack/unpack silently ignores unknown directives

Issue #19150 has been reported by Eregon (Benoit Daloze).

----------------------------------------
Bug #19150: pack/unpack silently ignores unknown directives
https://bugs.ruby-lang.org/issues/19150

* Author: Eregon (Benoit Daloze)
* Status: Open
* Priority: Normal
* Backport: 2.7: UNKNOWN, 3.0: UNKNOWN, 3.1: UNKNOWN
----------------------------------------
But I believe it should be an error instead.
Typically when a parser sees a syntax error it should fail not continue silently.

For instance `[1].pack('<L')` succeeds and only emits a warning if `$VERBOSE` is true.
This behavior caused confusion in https://github.com/oracle/truffleruby/issues/2791

I think it should fail with an `ArgumentError` instead.

Extracted from https://bugs.ruby-lang.org/issues/19108#note-3



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>