Subject: Re: leading '=' in enviroment variable truncated
From: Bart Schaefer <[email-masked]>
To: Zsh hackers list <[email-masked]>
Date: Sun, 8 May 2016 15:16:46 -0700
List-Id: Zsh Workers List <zsh-workers.zsh.org>

On Sun, May 8, 2016 at 2:58 PM, Bart Schaefer <[email-masked]> wrote:
>
> If we're going to go so far as to have a configure test, shouldn't we
> include a check that setenv is in fact defined before attempting to
> run a test that uses it?

Never mind.  You included the test but spelled "setenv" wrong, and I
missed that you'd tested anything at all.

However, even if I change the "setsnv" to "setenv" the test still gets
the wrong results.

conftest.c:259:4: warning: type specifier missing, defaults to 'int'
[-Wimplicit-int]
   main()
   ^~~~
conftest.c:261:7: warning: implicit declaration of function 'setenv'
is invalid in C99 [-Wimplicit-function-declaration]
      setenv("NAME", "=VALUE", 1);
      ^
conftest.c:262:29: warning: implicit declaration of function 'getenv'
is invalid in C99 [-Wimplicit-function-declaration]
      return strcmp((char *)getenv("NAME"), "=VALUE");
                            ^
conftest.c:262:21: warning: cast to 'char *' from smaller integer type
'int' [-Wint-to-pointer-cast]
      return strcmp((char *)getenv("NAME"), "=VALUE");
                    ^
4 warnings generated.
configure:12601: $? = 0
configure:12601: ./conftest
./configure: line 1719: 90473 Segmentation fault: 11  (core dumped)
./conftest$ac_exeext