Bug 281920 - devel/rlwrap: doesn't build, rl_message error
Summary: devel/rlwrap: doesn't build, rl_message error
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-07 11:57 UTC by Zsolt Udvari
Modified: 2024-10-07 14:14 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (gamato)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zsolt Udvari freebsd_committer freebsd_triage 2024-10-07 11:57:53 UTC
cc -DHAVE_CONFIG_H -I. -I..    -I/usr/local/include -DDATADIR=\"/usr/local/share\" -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing -MT readline.o -MD -MP -MF .deps/readline.Tpo -c -o readline.o readline.c
readline.c:192:16: error: too many arguments to function call, expected 0, have 1
  192 |     rl_message(message);
      |     ~~~~~~~~~~ ^~~~~~~
/usr/local/include/readline/readline.h:410:12: note: 'rl_message' declared here
  410 | extern int rl_message (void);
      |            ^
1 error generated.
*** Error code 1

Stop.

The relevant part of readline.h:

#if defined (USE_VARARGS) && defined (PREFER_STDARG)                            
extern int rl_message (const char *, ...)  __attribute__((__format__ (printf, 1, 2)));
#else                                                                           
extern int rl_message ();                                                       
#endif                  


I think the USE_VARARGS or PREFER_STDARG isn't defined.
Comment 1 Konstantin Belousov freebsd_committer freebsd_triage 2024-10-07 12:07:14 UTC
The problem is that rlstd.c has the following block:
/* Moved from config.h.in because readline.h:rl_message depends on these
   defines. */
#if defined (__STDC__) && defined (HAVE_STDARG_H)
#  define PREFER_STDARG
#  define USE_VARARGS

which checks for HAVE_STDARG_H.  This assumes that the consumer a) uses
autoconf b) checks for stdarg.h c) includes config.h before any readline
headers.

As a temp fix,
CFLAGS+= -DHAVE_STDARG_H
helps.
Comment 2 commit-hook freebsd_committer freebsd_triage 2024-10-07 14:13:20 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=e52e44fc0c271a1250991d648867319db93cb605

commit e52e44fc0c271a1250991d648867319db93cb605
Author:     Zsolt Udvari <uzsolt@FreeBSD.org>
AuthorDate: 2024-10-07 14:10:19 +0000
Commit:     Zsolt Udvari <uzsolt@FreeBSD.org>
CommitDate: 2024-10-07 14:12:34 +0000

    devel/rlwrap: fix rl_message() build error

    Should define HAVE_STDARG_H and as a temporary fix add it to CFLAGS.
    While I'm here, remove GNU_CONFIGURE_MANPREFIX and unneeded
    python_OLD_CMD (declared already).

    PR:             281920
    Approved by:    portmgr (blanket)

 devel/rlwrap/Makefile | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
Comment 3 Zsolt Udvari freebsd_committer freebsd_triage 2024-10-07 14:14:50 UTC
(In reply to Konstantin Belousov from comment #1)
Thanks for quick fix!