[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Lynx-dev] Porting the configure script to C99
From: |
Florian Weimer |
Subject: |
Re: [Lynx-dev] Porting the configure script to C99 |
Date: |
Fri, 02 Dec 2022 23:16:32 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
* 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:
| 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:
| 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