<div>Could you explain me how to define it (and where)?</div><div><br /></div><div><br /></div><div>15.05.2022, 21:25, "Thomas Dickey" <dickey@his.com>:</div><blockquote><p>On Sun, May 15, 2022 at 07:26:34PM -0400, Thomas Dickey wrote:<br /></p><blockquote class="210e7a848e8fcb45wmi-quote"> ----- Original Message -----<br /> | From: "alexandre schenberg" <<a href="mailto:ale.schenberg@yandex.com">ale.schenberg@yandex.com</a>><br /> | To: <a href="mailto:xorg@lists.x.org">xorg@lists.x.org</a><br /> | Sent: Sunday, May 15, 2022 7:06:12 PM<br /> | Subject: Malloc error when cross compiling libXt-1.2.1<br /> <br /> | Hello. When I try to cross compile libXT 1.2.1 (or any version) for i386, I<br /> | receive:<br /> | <br /> || configure:18569: checking whether malloc(0) returns NULL<br /> <br /> looks like<br /> <br /> <a href="https://gitlab.freedesktop.org/xorg/lib/libxt/-/blob/edd70bdfbbd16247e3d9564ca51d864f82626eb7/configure.ac">https://gitlab.freedesktop.org/xorg/lib/libxt/-/blob/edd70bdfbbd16247e3d9564ca51d864f82626eb7/configure.ac</a><br /> <br /> XORG_CHECK_MALLOC_ZERO<br /> <br /> which comes from here:<br /> <br /> <a href="https://gitlab.freedesktop.org/xorg/util/macros/-/blob/master/xorg-macros.m4.in">https://gitlab.freedesktop.org/xorg/util/macros/-/blob/master/xorg-macros.m4.in</a><br /> <a href="https://gitlab.freedesktop.org/xorg/util/macros/-/blob/master/xorg-macros.m4.in#L1370">https://gitlab.freedesktop.org/xorg/util/macros/-/blob/master/xorg-macros.m4.in#L1370</a><br /> <br /> and as explained here<br /> <br /> <a href="https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Runtime.html">https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Runtime.html</a><br /> <br /> it's lacking a third choice on the end of the AC_RUN_IFELSE macro.<br /> Overlooked here:<br /> <br /> <a href="https://gitlab.freedesktop.org/xorg/util/macros/-/commit/af0164c2ded2dcc95b72ca3b9bfbad9b790490f7">https://gitlab.freedesktop.org/xorg/util/macros/-/commit/af0164c2ded2dcc95b72ca3b9bfbad9b790490f7</a><br /></blockquote><p><br />It's used in Alloc.c in Xt:<br /><br /><a href="https://gitlab.freedesktop.org/xorg/lib/libxt/-/blob/edd70bdfbbd16247e3d9564ca51d864f82626eb7/src/Alloc.c#L167">https://gitlab.freedesktop.org/xorg/lib/libxt/-/blob/edd70bdfbbd16247e3d9564ca51d864f82626eb7/src/Alloc.c#L167</a><br /><br />which notwithstanding the comment, the C standard doesn't offer much help:<br /><br /><a href="https://stackoverflow.com/questions/2132273/what-does-malloc0-return">https://stackoverflow.com/questions/2132273/what-does-malloc0-return</a><br /><br />...so the safest thing to do with the macro would be to supply a warning<br />and define MALLOC_0_RETURNS_NULL<br /> <br /></p><span class="f55bbb4eeef208e8wmi-sign">-- <br />Thomas E. Dickey <<a href="mailto:dickey@invisible-island.net">dickey@invisible-island.net</a>><br /><a href="https://invisible-island.net/">https://invisible-island.net</a><br /><a href="ftp://ftp.invisible-island.net/">ftp://ftp.invisible-island.net</a><br /></span></blockquote>