[MacPorts] #55145: gawk @4.2.0 fails to build on PPC Tiger, Mac OS X 10.4.11, because void unsetenv() does not return an integer value for comparison
MacPorts
noreply at macports.org
Sun Oct 22 12:07:02 UTC 2017
#55145: gawk @4.2.0 fails to build on PPC Tiger, Mac OS X 10.4.11, because void
unsetenv() does not return an integer value for comparison
-----------------------+-------------------
Reporter: ballapete | Owner:
Type: defect | Status: new
Priority: Normal | Milestone:
Component: ports | Version: 2.4.2
Keywords: tiger | Port: gawk
-----------------------+-------------------
This is the failure:
{{{
/opt/local/bin/gcc-apple-4.2 -std=gnu99
-DDEFPATH='".:/opt/local/share/awk"'
-DDEFLIBPATH="\"/opt/local/lib/gawk\"" -DSHLIBEXT="\"so"\" -DHAVE_CONFIG_H
-DGAWK -DLOCALEDIR='"/opt/local/share/locale"' -I"./support" -I.
-I/opt/local/include -I/opt/local/include -pipe -Os -arch ppc -DNDEBUG
-MT builtin.o -MD -MP -MF .deps/builtin.Tpo -c -o builtin.o builtin.c
builtin.c: In function 'mktime_tz':
builtin.c:2068: error: void value not ignored as it ought to be
make[2]: *** [builtin.o] Error 1
make[2]: Leaving directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_lang_gawk/gawk/work/gawk-4.2.0'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_lang_gawk/gawk/work/gawk-4.2.0'
make: *** [all] Error 2
make: Leaving directory
`/opt/local/var/macports/build/_opt_local_var_macports_sources_lil.fr.rsync.macports.org_release_tarballs_ports_lang_gawk/gawk/work/gawk-4.2.0'
}}}
`builtin.c` has here:
{{{
2049 static time_t
2050 mktime_tz(struct tm *tm, const char *tzreq)
2051 {
2052 time_t ret;
2053 char *tz = getenv("TZ");
2054
2055 if (tz)
2056 tz = estrdup(tz, strlen(tz));
2057 if (setenv("TZ", tzreq, 1) < 0) {
2058 warning(_("setenv(TZ, %s) failed (%s)"), tzreq,
strerror(errno));
2059 return -1;
2060 }
2061 tzset();
2062 ret = mktime(tm);
2063 if (tz) {
2064 if (setenv("TZ", tz, 1) < 0)
2065 fatal(_("setenv(TZ, %s) restoration failed
(%s)"), tz, strerror(errno));
2066 free(tz);
2067 } else {
2068 if (unsetenv("TZ") < 0)
2069 fatal(_("unsetenv(TZ) failed (%s)"),
strerror(errno));
2070 }
2071 tzset();
2072 return ret;
2073 }
}}}
The function `unsetenv` is defined in Tiger as:
{{{
void unsetenv(const char *);
}}}
Since `tz` obviously is empty (`if (tz)` is `false`, because `mktime()` or
`tzset()` do not set "TZ"?), why try to `unsetenv()` it? Or what else is
the purpose?
--
Ticket URL: <https://trac.macports.org/ticket/55145>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list