I tried compiling bash with musl-gcc and failed due to the __P macros
in histfile.c

While digging around it appears that __P is defined in stdc.h, but
histfile.c indirectly includes rlstdc.h istead. rlstdc.h defines an
identical macro with the name PARAMS instead of __P

In my extraordinarily limited testing the switch from __P to PARAMS
seems to work. That being said I'm not sure why the usage of __P
worked with gcc but not musl-gcc yet, maybe someone more familiar with
the code could pitch in and let me know if I've done something wrong.

I've attached the patch against the devel branch HEAD.

-emg
From 4d533ebe10316dbb511088ecc92a4978ad3f0ad5 Mon Sep 17 00:00:00 2001
From: Evan Gates <evan.ga...@gmail.com>
Date: Wed, 8 Apr 2015 08:17:11 -0700
Subject: [PATCH] change __P to PARAMS in histfile.c

as far as I can tell histfile.c indirectly includes rlstdc.h not stdc.h
both define similar macros the former as PARAMS and the latter as __P
---
 lib/readline/histfile.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/readline/histfile.c b/lib/readline/histfile.c
index 4c23785..a5af01e 100644
--- a/lib/readline/histfile.c
+++ b/lib/readline/histfile.c
@@ -124,9 +124,9 @@ int history_lines_written_to_file = 0;
    for more extensive tests. */
 #define HIST_TIMESTAMP_START(s)                (*(s) == history_comment_char 
&& isdigit ((unsigned char)(s)[1]) )
 
-static char *history_backupfile __P((const char *));
-static int histfile_backup __P((const char *, const char *));
-static int histfile_restore __P((const char *, const char *));
+static char *history_backupfile PARAMS((const char *));
+static int histfile_backup PARAMS((const char *, const char *));
+static int histfile_restore PARAMS((const char *, const char *));
 
 /* Return the string that should be used in the place of this
    filename.  This only matters when you don't specify the
-- 
2.3.5

Reply via email to