[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] awk_ext_id_t inconsistency
From: |
Andrew J. Schorr |
Subject: |
Re: [bug-gawk] awk_ext_id_t inconsistency |
Date: |
Sun, 7 Jan 2018 10:18:29 -0500 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hi Panos,
On Sun, Jan 07, 2018 at 01:10:34PM +0200, Panos Papadopoulos wrote:
> ext_id is a pointer to awk_ext_id_t or just of type awk_ext_id_t?
> Please have a look in these two screenshots from the user guide:
>
> [image: Ενσωματωμένη εικόνα 2]
>
>
> [image: Ενσωματωμένη εικόνα 1]
>
As you point out, there's an inconsistency. The boilerplate code
in the manual says:
static awk_ext_id_t ext_id;
whereas the chdir/stat example says:
static awk_ext_id_t *ext_id;
Looking in gawkapi.h, we see:
typedef void *awk_ext_id_t; /* opaque type for extension id */
So I think that "static awk_ext_id_t ext_id" is correct,
and "static awk_ext_id_t *ext_id" is incorrect. Thanks for catching
this. In reality, I don't think we actually use this anywhere, so that's
why this has slipped under the radar. This seems to be incorrect in every
extension actually shipped with gawk:
bash-4.2$ grep ext_id_t extension/*.c
extension/filefuncs.c:static awk_ext_id_t *ext_id;
extension/fnmatch.c:static awk_ext_id_t *ext_id;
extension/fork.c:static awk_ext_id_t *ext_id;
extension/inplace.c:static awk_ext_id_t *ext_id;
extension/intdiv.c:static awk_ext_id_t *ext_id;
extension/ordchr.c:static awk_ext_id_t *ext_id;
extension/readdir.c:static awk_ext_id_t *ext_id;
extension/readdir_test.c:static awk_ext_id_t *ext_id;
extension/readfile.c:static awk_ext_id_t *ext_id;
extension/revoutput.c:static awk_ext_id_t *ext_id;
extension/revtwoway.c:static awk_ext_id_t *ext_id;
extension/rwarray.c:static awk_ext_id_t *ext_id;
extension/rwarray0.c:static awk_ext_id_t *ext_id;
extension/testext.c:static awk_ext_id_t *ext_id;
extension/time.c:static awk_ext_id_t *ext_id;
Regards,
Andy
- [bug-gawk] Manual typo?, Panos Papadopoulos, 2018/01/07
- Re: [bug-gawk] awk_ext_id_t inconsistency,
Andrew J. Schorr <=