lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Lynx-dev] Porting the configure script to C99


From: Thomas Dickey
Subject: Re: [Lynx-dev] Porting the configure script to C99
Date: Fri, 2 Dec 2022 20:14:53 -0500
User-agent: Mutt/1.10.1 (2018-07-13)

On Fri, Dec 02, 2022 at 11:16:32PM +0100, Florian Weimer wrote:
> * Thomas Dickey:
> 
> >> diff --git a/configure b/configure
> >> index 97f6d1d5646d05c5..6db52b514b3b9a3c 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -31122,6 +31122,7 @@ else
> >>  #line 31122 "configure"
> >>  #include "confdefs.h"
> >>  
> >> +#include <stdio.h>
> >>  #if HAVE_TERMIO_H
> >>  #include <termio.h>
> >>  #endif
> >> @@ -31629,6 +31630,9 @@ else
> >>  #line 31629 "configure"
> >>  #include "confdefs.h"
> >>  /* Thanks to Mike Rendell for this test.  */
> >> +#if HAVE_UNISTD_H
> >> +# include <unistd.h>
> >> +#endif
> >
> > "middle chunk" is referring to this, I suppose.
> >
> > AC_INCLUDES_DEFAULT includes a lot of headers, not just this one.
> >
> > what problem does that #include solve?
> 
> Our configure says this at the top: “Generated by Autoconf
> 2.52.20210509.”  I don't think it uses AC_INCLUDES_DEFAULT yet, it
> seems:

I was actually talking about the "newer" version of autoconf.

But it's simple to add.
 
> | configure: failed program was:
> | #line 31629 "configure"
> | #include "confdefs.h"
> | /* Thanks to Mike Rendell for this test.  */
> | #include <sys/types.h>
> | #define NGID 256
> | #undef MAX
> | #define MAX(x, y) ((x) > (y) ? (x) : (y))
> | 
> | int
> | main (void)
> | {
> |   gid_t gidset[NGID];
> |   int i, n;
> |   union { gid_t gval; long lval; }  val;
> | 
> |   val.lval = -1;
> |   for (i = 0; i < NGID; i++)
> |     gidset[i] = val.gval;
> |   n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1,
> |                  gidset);
> |   /* Exit non-zero if getgroups seems to require an array of ints.  This
> |      happens when gid_t is short but getgroups modifies an array of ints.  
> */
> |   return ((n > 0 && gidset[n] != val.gval) ? 1 : 0);
> | }
> 
> Full build log is here:
> 
>   
> <https://gitlab.com/fweimer-rh/fedora-modernc-logs/-/blob/fbf287fbe1e977fad4ef23390174e6f6d584f5c7/logs/l/lynx.log>
> 
> >>  #include <sys/types.h>
> >>  #define NGID 256
> >>  #undef MAX
> >> @@ -47492,6 +47496,7 @@ else
> >>  #line 47492 "configure"
> >>  #include "confdefs.h"
> >>  
> >> +#include <stdio.h>
> >
> > ...shouldn't be needed, since both curses.h and slang.h include stdio.h
> > (LYCurses.h includes one or the other, as well as HTUtils.h)
> 
> Okay, my mistake, but the first putchar change *is* needed:

sounds good.  Actually this report is like another which talks about tgoto
and arc4random (which I intended fixing).  I'll have some improvements
in this area for dev.11 (changing those requires testing in different
configurations -- unlike these).
 
> | configure: In function 'main':
> | configure:31133:1: error: implicit declaration of function 'putchar'
> | 31133 | {
> |       | ^      
> | configure:31143: $? = 1
> | configure: failed program was:
> | #line 31122 "configure"
> | #include "confdefs.h"
> | 
> | #if HAVE_TERMIO_H
> | #include <termio.h>
> | #endif
> | #if HAVE_TERMIOS_H
> | #include <termios.h>
> | #endif
> | int
> | main (void)
> | {
> | putchar (0x0a)
> |   ;
> |   return 0;
> | }
> 
> Thanks,
> Florian
> 

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
ftp://ftp.invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]