Re: [PATCH] passes: Make gcc buildable again with mawk <= 1.3.3

Nathan Sidwell <[email protected]> Wed, 5 Aug 2026 13:34:33 -0400
Newsgroups gmane.comp.gcc.patches
Message-ID <[email protected]>
Thanks Jakub!

On 20/07/2026 12:41, Jakub Jelinek wrote:
> On Wed, Jul 15, 2026 at 12:49:50PM -0400, Nathan Sidwell wrote:
>> Fair enough, I committed this
> 
> Unfortunately it seems some versions of Debian/Ubuntu use mawk instead
> of gawk by default, and mawk pretends to be POSIX compatible, but at least
> versions <= 1.3.3 didn't support POSIX character classes.
> We don't really need the various UTF-8 fancy blanks, and even this very
> own script already uses sub(/^[ \t]*/, "", arg3); elsewhere, so this
> patch just replaces [[:blank:]] with [ \t].
> 
> Tested on x86_64-linux (though, Fedora with gawk), ok for trunk?
> 
> 2026-07-20  Jakub Jelinek  <[email protected]>
> 
> 	* gen-pass-instances.awk: Use [ \t] instead of [[:blank:]]
> 	for compatibility with mawk <= 1.3.3.
> 
> --- gcc/gen-pass-instances.awk.jj	2026-07-16 09:44:33.627721893 +0200
> +++ gcc/gen-pass-instances.awk	2026-07-20 18:32:00.542130598 +0200
> @@ -167,17 +167,17 @@ function replace_pass(line, fnname,			nu
>     lines[num] = new_line;
>   }
>   
> -/^[[:blank:]]*INSERT_PASS_AFTER \(.+\)/ {
> +/^[ \t]*INSERT_PASS_AFTER \(.+\)/ {
>     insert_pass($0, "INSERT_PASS_AFTER", 1);
>     next;
>   }
>   
> -/^[[:blank:]]*INSERT_PASS_BEFORE \(.+\)/ {
> +/^[ \t]*INSERT_PASS_BEFORE \(.+\)/ {
>     insert_pass($0, "INSERT_PASS_BEFORE", 0);
>     next;
>   }
>   
> -/^[[:blank:]]*REPLACE_PASS \(.+\)/ {
> +/^[ \t]*REPLACE_PASS \(.+\)/ {
>     replace_pass($0, "REPLACE_PASS");
>     next;
>   }
> 
> 
> 	Jakub
> 


-- 
Nathan Sidwell