ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Ivan A. Melnikov" <iv@altlinux.org>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: [devel] man-db vs gdbm // was: Re: I: gcc 15.2.1 && binutils 2.46
Date: Tue, 28 Apr 2026 15:29:11 +0400
Message-ID: <afCHEjyoz2rvV2am@iv-work> (raw)
In-Reply-To: <ae3qdUWiT263fSdJ@glebfm.altlinux.org>

On Sun, Apr 26, 2026 at 01:35:33PM +0300, Gleb Fotengauer-Malinovskiy wrote:
> man-db	legion @core iv
[...]
> 	The meaning of function declarations of the form rettype identifier (); such as
> 	char *strstr (); changed in C23.
> 	In C17 and earlier, such function declarators specified no information about
> 	the number or types of the parameters of the function (C17 6.7.6.3), requiring
> 	users to know the correct number of arguments, with each passed argument going
> 	through default argument promotion.
> 	In C23 such declarations mean (void) i.e. a function taking no arguments, which
> 	can lead to build failures on code that relied on the earlier meaning.

Конкретно в man-db проблема сборки вызвана gdbm, который предоставляет
некорректный прототип для функции gdbm_open.

Немного подробностей.

В нашем gdbm 1.8.3 gdbm_open определён так:

gdbm_file_info *gdbm_open __P((char *, int, int, int, void (*) (void)));

Последний аргумент -- callback на случай ошибок. Он всегда вызывается
с дополнительным аргументом типа char* (а на самом деле это const char*),
описывающем, что же произошло:

https://git.altlinux.org/gears/g/gdbm.git?a=blob;f=gdbm/update.c;h=71c5731a10ad09ba3b14bed6f857d906eb311a68#l122

Тут ещё можно сказать, что это не прототип у gdbm_open неправильный,
а старосишный стиль такой: кому нужен дополнительный аргумент тот возьмёт.

Однако начиная с вышедшего в 2011 году gdbm 1.9 апстрим перешёл на
более актуальный диалект C и стал определять gdbm_open так:

extern GDBM_FILE gdbm_open (const char *, int, int, int,
                            void (*)(const char *));

Примерно в таком виде эта функция определена в gdbm, поставляемом
во всех актуальных дистрибутивах, кроме Альт и каких-то деривативов
RHEL6, если диривативы RHEL6 ещё можно считать актуальными,
и именно на такой прототип рассчитывает апстрим man-db.

Кстати, на данный момент gdbm не пресобирается в том числе и из-за
описаной выше проблемы:

update.c:122:6: error: too many arguments to function 'dbf->fatal_err';
expected 0, have 1
  122 |     (*dbf->fatal_err) (val);
      |     ~^~~~~~~~~~~~~~~~  ~~~




Уважаемые @core, в рамках починки gdbm вы планируете её обновлять
(последняя версия датируется 2025 годом, наша из 2002-го) или
хотя бы предоставить корректный прототип gdbm_open?

Или клиентам gdbm нужно костылями обкладываться?

-- 
  wbr,
    iv m.


  reply	other threads:[~2026-04-28 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-26 10:35 [devel] " Gleb Fotengauer-Malinovskiy
2026-04-28 11:29 ` Ivan A. Melnikov [this message]
2026-04-30  9:26   ` [devel] man-db vs gdbm // was: " Sergey Afonin
2026-04-30 11:03     ` Ivan A. Melnikov

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=afCHEjyoz2rvV2am@iv-work \
    --to=iv@altlinux.org \
    --cc=devel@lists.altlinux.org \
    /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

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git