[PATCH 1/2] Revert "stdlib: Support malloc-managed environ arrays for compatibility"

Florian Weimer fweimer@redhat.com
Fri Jan 24 22:27:37 GMT 2025


* H. J. Lu:

>> This looks okay, although it's not clear to me why you do not use
>> TEST_COMPARE_STRING.  If you want to minimize includes (not unreasonable
>> for this test), use
>>
>>   return valp[0] == '1' && valp[1] == '\0';
>
> Did you mean
>
> return valp[0] == '1' && valp[1] == '\0' ? 0 : 1;

Yes.

> But stdlib/tst-setenv-environ.out will be empty when it fails.
>
> TEST_VERIFY_EXIT (valp[0] == '1' && valp[1] == '\0');
>
> tells you what failed.

But then you can use:

  TEST_COMPARE_STRING (valp, "1");

It gives you an even better diagnostic.

Thanks,
Florian



More information about the Libc-alpha mailing list