On Mon, 27 Oct 2025, [email protected] wrote:
> + fwrite (data_to_write, sizeof(char), strlen(data_to_write), fptr);
Missing spaces before '('
> + char *env_val = (char *) xmalloc (strlen (temp_file) + strlen(prefix)
> + 2);
Likewise.
> diff --git a/gcc/testsuite/gcc.dg/longcmd/pr111527-1.c
> b/gcc/testsuite/gcc.dg/longcmd/pr111527-1.c
> new file mode 100644
> index 00000000000..a5373f57790
> --- /dev/null
> +++ b/gcc/testsuite/gcc.dg/longcmd/pr111527-1.c
> @@ -0,0 +1,44 @@
> +/* { dg-do run } */
This runs on the target; that may not make the file it creates available
on the host. See e.g. gcc.dg/compat/struct-layout-1.exp for how to run a
generator program on the host.
> diff --git a/gcc/testsuite/gcc.misc-tests/outputs.exp
> b/gcc/testsuite/gcc.misc-tests/outputs.exp
> index 6fd40d714e0..9b553549d9c 100644
> --- a/gcc/testsuite/gcc.misc-tests/outputs.exp
> +++ b/gcc/testsuite/gcc.misc-tests/outputs.exp
> @@ -343,99 +343,99 @@ outest "$b-5 exe default 1" $sing "$oaout" {} {{$aout}}
> outest "$b-6 exe default 2" $mult "$oaout" {} {{$aout}}
Could you please explain what all the changes to this file have to do with
the subject matter of the patch and why they are correct / desirable?
> diff --git a/libiberty/env-extended.c b/libiberty/env-extended.c
> new file mode 100644
> index 00000000000..afd6beea83a
> --- /dev/null
> +++ b/libiberty/env-extended.c
> @@ -0,0 +1,68 @@
> +/* Extended getenv implementation for handling very long environment
> variables.
> + Copyright (C) 1992-2025 Free Software Foundation, Inc.
> + Written by Fred Fish @ Cygnus Support
Those dates and author information seem unlikely to be correct for this
new code.
> +char* getenv_extended (const char* var_name)
The return type should be on its own line, and there should be a space
before not after '*' (likewise below).
> + if (string == NULL)
> + {
> + return NULL;
> + }
Redundant braces around single statement.
> + free(new_string);
Missing space before '('.
> + // Return the environment variable as-is if no file is referenced
I don't think we generally use // comments in C code (which libiberty is).
--
Joseph S. Myers
[email protected]