Artificial intelligent assistant

Is "warning: range of the form `[o-b]' is locale dependent" a bug in gawk 4.1.0? While writing some `awk` code I was using the `--lint` option for `gawk` 4.1.0. To my surprise I get a warning > warning: range of the form `[o-b]' is locale dependent but my code has only a `foo-bar` outside of a character class. Simplified example: { match($2, /^uid=([^,]+),dc=foo-bar$/, m) } Also I think gawk 4.2.1 does no longer output that warning, so is it a bug in `gawk`?

This is a bug in Gawk 4.1.0 specifically. It was introduced by a7c502a756732ec9a1773d6169376bb7b25f4308 and fixed by d52d17b46e53bb0d4a991cd32f859eb349d3b101. The bug was first released in 4.1.0 and the fix was first released 4.1.1.

This is only a bug in the linter, not a bug in the code that is used to actually match text against the regular expression.

The bug causes the linter to keep looking past the closing bracket when it's looking for ranges in sets, so when it sees `[set]more stuff with a-dash`, it reaches the subsequent `-` and emits the warning. A workaround (if you really need a workaround for a linter-only bug in an old version) is to put the dash itself in a range: `/^uid=([^,]+),dc=foo[-]bar$/` in your case. This may not work in all corner cases.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 6f274e7d495e7915c322b6142c809b73