Skip to content

printf: quote ignored chars in the character constant warning - #16509

Merged
sylvestre merged 1 commit into
uutils:mainfrom
tridev-tej:fix-issue-16494
Nov 15, 2026
Merged

sylvestre merged 1 commit into
uutils:mainfrom
tridev-tej:fix-issue-16494

Conversation

@tridev-tej

Copy link
Copy Markdown
Contributor

the character constant warning printed the ignored chars raw, so printf '%x\n' "'ABC" warned about BC instead of 'BC'. now they get escaped and quoted the same way the other numeric errors quote their input, so a tab shows up as '\tW'. updated the existing expectations and added a tab case. the ignored test from #16493 should pass with this.

Fixes #16494

escape and quote the trailing chars the same way the other numeric
errors quote their input, so 'ABC now warns about 'BC' instead of BC.
locale_aware_escape_name(OsStr::new(&rest), QuotingStyle::Escape);
show_warning!(
"{rest}: character(s) following character constant have been ignored"
"{}: character(s) following character constant have been ignored",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use translate!()

(i didn't realized that we didn't have that before)

@sylvestre
sylvestre merged commit e227c61 into uutils:main Nov 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

printf: quote ignored chars in the character constant warning

2 participants