Repository navigation
Conversation
|
Can we use regular sparse file instead of memfd, and support more targets? |
f1c058d to
c2ec6b2
Compare
|
Replaced memfd with a regular sparse file and enabled the test on Unix targets. It skips if the filesystem can’t support the required file size. |
c2ec6b2 to
468f221
Compare
| wc-error-total-bytes-overflow = total bytes: Value too large for defined data type | ||
| wc-error-total-chars-overflow = total characters: Value too large for defined data type | ||
| wc-error-total-lines-overflow = total lines: Value too large for defined data type | ||
| wc-error-total-words-overflow = total words: Value too large for defined data type |
There was a problem hiding this comment.
Would you dedup similar part? By the way, we can choice different error message with GNU if we don't change it's meaning. So we could simply extract error message from std.
468f221 to
df1a0a2
Compare
|
Extracted the repeated overflow wording into a shared Fluent message used by all four diagnostics. |
| } | ||
|
|
||
| if settings.total_when.is_total_row_visible(num_inputs) { | ||
| for (overflowed, (enabled, message)) in total_overflow.into_iter().zip([ |
There was a problem hiding this comment.
could you please print these in the same order as the columns (lines, words, chars, bytes)? that's also the order GNU uses when several overflow
| impl WordCount { | ||
| /// Accumulate counts, saturating each independently. Return overflow flags | ||
| /// for the byte, character, line, and word counts, in that order. | ||
| pub fn accumulate(&mut self, other: Self) -> [bool; 4] { |
There was a problem hiding this comment.
returning a [bool; 4] that callers have to zip by position is easy to get wrong.
could the overflow flags be named fields instead (a small struct, or kept in WordCount)?
Use 64-bit counters and checked accumulation for each total, reporting an error when a displayed count overflows. Saturate the metadata size sum used for column widths and cover total output modes with a sparse file regression test. Closes uutils#11209
df1a0a2 to
da50ac4
Compare
Use 64-bit counters and checked accumulation for each total, reporting an error when a displayed count overflows. Saturate the metadata size sum used for column widths and cover total output modes with a sparse memfd regression test.
Closes #11209