Page MenuHomeFreeBSD

awk: revert upstream's attempt to disallow hex strings
ClosedPublic

Authored by imp on Jul 15 2021, 10:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 8, 4:04 AM
Unknown Object (File)
Tue, Nov 5, 3:15 PM
Unknown Object (File)
Oct 5 2024, 9:53 PM
Unknown Object (File)
Oct 4 2024, 7:41 PM
Unknown Object (File)
Oct 4 2024, 5:02 PM
Unknown Object (File)
Oct 2 2024, 1:10 AM
Unknown Object (File)
Oct 1 2024, 10:25 PM
Unknown Object (File)
Sep 30 2024, 6:57 PM
Subscribers
None

Details

Summary

Upstream one-true-awk decided to disallow hex strings as numbers. This
is in line with awk's behavior prior to C99, and allowed by the POSIX
standard. The standard, however, allows them to be treated as numbers
because that's what the standard said in the 2001 through 2004 editions.
Since 2001, the nawk in FreeBSD has treated them as numbers, so restore
that behavior, allowed by the standard.

A number of scripts in the FreeBSD tree depend on this interpretation,
including scripts to build the kernel which had mysteriously started
failing for some people and not others. By re-allowing 0x hex numbers,
this fixes those scripts and restores POLA.

Upstream issue: https://github.com/onetrueawk/awk/issues/126
Sponsored by: Netflix
MFC After: ASAP

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 40494
Build 37383: arc lint + arc unit

Event Timeline

imp requested review of this revision.Jul 15 2021, 10:52 PM
imp created this revision.

This test makes more sense.

imp added a reviewer: kevans.
kevans added inline comments.
contrib/one-true-awk/lib.c
801

prior

This revision is now accepted and ready to land.Jul 15 2021, 10:59 PM