Re: [PATCH 5/5] test: dupstruct: fix extra duplicate identifier case

Kris Van Hees <[email protected]>
Newsgroups dev.linux.lists.dtrace
Message-ID <[email protected]>
On Mon, Oct 06, 2025 at 04:28:28PM +0100, Nick Alcock wrote:
> We were failing to handle one case where duplicate members or variables
> are now reported as duplicate members, enumerators, or variables.
> (It was concealed inside an .r.p.)
> 
> Signed-off-by: Nick Alcock <[email protected]>

Reviewed-by: Kris Van Hees <[email protected]>

> ---
>  test/unittest/types/err.D_UNKNOWN.dupstruct.r | 2 +-
>  test/utils/libctf.r.p                         | 3 ++-
>  2 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/test/unittest/types/err.D_UNKNOWN.dupstruct.r b/test/unittest/types/err.D_UNKNOWN.dupstruct.r
> index 7afa74aa7f6d7..762b24f4c5901 100644
> --- a/test/unittest/types/err.D_UNKNOWN.dupstruct.r
> +++ b/test/unittest/types/err.D_UNKNOWN.dupstruct.r
> @@ -1,2 +1,2 @@
>  -- @@stderr --
> -dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member or variable name
> +dtrace: failed to compile script test/unittest/types/err.D_UNKNOWN.dupstruct.d: [D_UNKNOWN] line 17: failed to define member 'x': Duplicate member, enumerator, or variable name
> diff --git a/test/utils/libctf.r.p b/test/utils/libctf.r.p
> index a2b4602cf713b..774eda7f57e1f 100755
> --- a/test/utils/libctf.r.p
> +++ b/test/utils/libctf.r.p
> @@ -1,7 +1,8 @@
>  #!/usr/bin/gawk -f
>  # Licensed under the Universal Permissive License v 1.0 as shown at
>  # http://oss.oracle.com/licenses/upl.
> -/Duplicate member or variable name\.$/ { sub(/\.$/, ""); }
> +/Duplicate member or variable name/ { sub(/Duplicate member/, "&, enumerator,"); }
> +/Duplicate member, enumerator, or variable name\.$/ { sub(/\.$/, ""); }
>  /Member name not found\.$/ { sub(/\.$/, ""); }
>  /enum union pirate:/ { sub(/enum union pirate/, "enum struct pirate"); }
>  { print; }
> -- 
> 2.51.0.284.g117bcb8de7
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.