[tin-bugs] (fwd) Cross-compilation of tin
Thomas Dickey
dickey at his.com
Sun Feb 5 12:52:40 CET 2023
On Sun, Feb 05, 2023 at 05:58:27AM -0500, Thomas Dickey wrote:
> On Sun, Feb 05, 2023 at 06:03:19AM +0100, Urs Janßen wrote:
> > Hello Thomas,
> >
> > would you mind to answer the following mail as it is mainly your code
> > and macro. IIRC free(NULL) was an issue > ~25 years ago on several
> > operating systems as it caused crashes (but I can't remeber which ones).
>
> I encountered this with SunOS 4 (and probably HP-UX) in getting the sam editor
> to work (perhaps 1993).
>
> fwiw, SunOS 4 was in use for development after 2000 :-)
>
> > And at least it should include "bool.h" not <bool.h> and
>
> The <bool.h> should work, assuming that the compiler's -I options are
> set up properly (to point to tin's include-directory).
>
> > <stdlib.h> and <string.h> not unconditionally.
>
> agree - those should be ifdef'd. For anything produced over the
> past 20 or so years, only unistd.h has been a problem, but
> recalling the xpg3 fixups that I did a couple of years ago,
> the conditional inclusion still applies.
>
> > Thanks,
> > urs
>
> > Date: Thu, 2 Feb 2023 22:36:59 +0300
> > From: uis <uis9936 at gmail.com>
> > To: tin-bugs at tin.org
> > Subject: [tin-bugs] Cross-compilation of tin
> >
> > While trying to cross-compile tin using crossdev on Gentoo, it failed to do
> > because makecfg.c includes tin.h which includes gsasl.h. Usually it is not
> > unexpected to do so, given the fact that sasl USE-flag was set, but it was
> > compiling tool for CBUILD. So gsasl was required on build system, which is
> > very wierd.
>
> ...well, a fix for that might be helpful.
>
> > Insted of simply installing tin into build system, I looked at source and
> > found that only thing needed from tin.h is FreeIfNeeded macro. And this
> > macro is free with condition of pointer being non-null. This macro doesn't
> > have different bahaviour compared to simple free(), if you look man 3 free,
>
> sure - tin builds/works with old systems that some people don't care about.
>
> > it says "If ptr is NULL, no operation is performed".
>
> reading the manual page may help (see the section on conformance).
>
> > I changed includes and code and now it should work. Patch attached
>
> the suggested patch isn't relevant to the reported bug.
see attached.
--
Thomas E. Dickey <dickey at invisible-island.net>
https://invisible-island.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tin-20230205.patch
Type: text/x-diff
Size: 1271 bytes
Desc: not available
URL: <http://lists.tin.org/pipermail/tin-bugs/attachments/20230205/43b1f211/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <http://lists.tin.org/pipermail/tin-bugs/attachments/20230205/43b1f211/attachment.sig>
More information about the tin-bugs
mailing list