From: Bernard Pidoux <bernard.f6bvp@gmail.com>
To: thomas@osterried.de
Cc: linux-hams@vger.kernel.org, Lee Woldanski <ve7fet@gmail.com>,
Bernard Pidoux <f6bvp@free.fr>
Subject: Re: ax25tools axgetput compile error
Date: Fri, 5 Aug 2022 11:41:51 +0200 [thread overview]
Message-ID: <CAFAa3YB4=1Wb9TXCDXeuM7ERQ+Cokgep+6AqNzb99pynw6b5mA@mail.gmail.com> (raw)
In-Reply-To: <CAFAa3YCsS23P3iYg9SXBuSbKX=-OECVqVa+9bLLy4yiv9fHX2A@mail.gmail.com>
Here are some changed I performed in order I could to achieve
ax25tools compilation:
mheard.c: In function ‘LoadPortData’:
../config.h:305:16: warning: implicit declaration of function
‘rpl_malloc’; did you mean ‘realloc’?
[-Wimplicit-function-declaration]
305 | #define malloc rpl_malloc
| ^~~~~~~~~~
mheard.c:261:22: note: in expansion of macro ‘malloc’
261 | pr = malloc(sizeof(struct PortRecord));
| ^~~~~~
mheard.c:261:20: warning: assignment to ‘struct PortRecord *’ from
‘int’ makes pointer from integer without a cast [-Wint-conversion]
261 | pr = malloc(sizeof(struct PortRecord));
| ^
https://lists.gnu.org/archive/html/automake/2003-05/msg00020.html
Removing the AC_FUNC_MALLOC in configure.ac solved it.
ll
DATA TYPES errors
In file included from beacon.c:1:
../config.h:304:15: error: two or more data types in declaration specifiers
304 | #define pid_t int
| ^~~
../config.h:301:16: error: two or more data types in declaration specifiers
301 | #define mode_t int
| ^~~
Edit configure.ac
dnl Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
#AC_TYPE_PID_T
#AC_TYPE_MODE_T
AC_TYPE_SIZE_T
m4_warn([obsolete],
I don't know why I still had to edit config.h redefinition
/* Define as a signed integer type capable of holding a process identifier. */
/* #define pid_t int */
Bernard
Am 30.07.2022 um 16:08 schrieb Bernard f6bvp <f6bvp@free.fr>:
As a turn around I added #include <sys/type.h to axgetput.c
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "includes.h"
#include "axgetput.h"
This add made compilation possible ... although with a number of
warnings in ax25tools compilation.
Ah. Oh. Interesiting.
Previous compiler versions "knew" what "int" is.
And yes, todays compilers also know what int is (i.e. int main() {};)
-- without including sys/types.h.
But the preprocessor is "before" the actual compiling stuff. Perhaps
there were reasons to make him less intelligent / more stupid.
I can't imagine why current gcc behaves so and considers this as error.
Btw, I recently compiled it on debian bullseye with
root@lax25-debug1:/usr/local/src/linux-ax25# gcc --version
gcc (Debian 10.2.1-6) 10.2.1 20210110
Copyright (C) 2020 Free Software Foundation, Inc.
..
Le ven. 5 août 2022 à 11:23, Bernard Pidoux <bernard.f6bvp@gmail.com> a écrit :
>
> Here are some changed I performed in order I could to achieve ax25tools compilation:
>
> mheard.c: In function ‘LoadPortData’:
> ../config.h:305:16: warning: implicit declaration of function ‘rpl_malloc’; did you mean ‘realloc’? [-Wimplicit-function-declaration]
> 305 | #define malloc rpl_malloc
> | ^~~~~~~~~~
> mheard.c:261:22: note: in expansion of macro ‘malloc’
> 261 | pr = malloc(sizeof(struct PortRecord));
> | ^~~~~~
> mheard.c:261:20: warning: assignment to ‘struct PortRecord *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
> 261 | pr = malloc(sizeof(struct PortRecord));
> | ^
> https://lists.gnu.org/archive/html/automake/2003-05/msg00020.html
>
> Removing the AC_FUNC_MALLOC in configure.ac solved it.
> ll
> DATA TYPES errors
>
> In file included from beacon.c:1:
> ../config.h:304:15: error: two or more data types in declaration specifiers
> 304 | #define pid_t int
> | ^~~
> ../config.h:301:16: error: two or more data types in declaration specifiers
> 301 | #define mode_t int
> | ^~~
>
> Edit configure.ac
>
> dnl Checks for typedefs, structures, and compiler characteristics.
> AC_HEADER_STDBOOL
> AC_C_CONST
> AC_TYPE_UID_T
> #AC_TYPE_PID_T
> #AC_TYPE_MODE_T
> AC_TYPE_SIZE_T
> m4_warn([obsolete],
>
> I don't know why I still had to edit config.h redefinition
>
> /* Define as a signed integer type capable of holding a process identifier. */
> /* #define pid_t int */
>
>
> Bernard
>
>
>
> Am 30.07.2022 um 16:08 schrieb Bernard f6bvp <f6bvp@free.fr>:
>
> As a turn around I added #include <sys/type.h to axgetput.c
>
> #include <sys/types.h>
>
> #ifdef HAVE_CONFIG_H
> #include <config.h>
> #endif
> #include "includes.h"
>
> #include "axgetput.h"
>
> This add made compilation possible ... although with a number of warnings in ax25tools compilation.
>
> Ah. Oh. Interesiting.
>
> Previous compiler versions "knew" what "int" is.
> And yes, todays compilers also know what int is (i.e. int main() {};) -- without including sys/types.h.
> But the preprocessor is "before" the actual compiling stuff. Perhaps there were reasons to make him less intelligent / more stupid.
>
> I can't imagine why current gcc behaves so and considers this as error.
>
>
> Btw, I recently compiled it on debian bullseye with
>
> root@lax25-debug1:/usr/local/src/linux-ax25# gcc --version
> gcc (Debian 10.2.1-6) 10.2.1 20210110
> Copyright (C) 2020 Free Software Foundation, Inc.
> ..
>
>
next parent reply other threads:[~2022-08-05 9:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CAFAa3YCsS23P3iYg9SXBuSbKX=-OECVqVa+9bLLy4yiv9fHX2A@mail.gmail.com>
2022-08-05 9:41 ` Bernard Pidoux [this message]
2022-08-05 10:50 ` ax25tools axgetput compile error Thomas Osterried
2022-07-30 8:37 Bernard f6bvp
2022-07-30 14:08 ` Bernard f6bvp
2022-07-30 19:56 ` Thomas Osterried
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFAa3YB4=1Wb9TXCDXeuM7ERQ+Cokgep+6AqNzb99pynw6b5mA@mail.gmail.com' \
--to=bernard.f6bvp@gmail.com \
--cc=f6bvp@free.fr \
--cc=linux-hams@vger.kernel.org \
--cc=thomas@osterried.de \
--cc=ve7fet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).