Package Details: cdecl 2.5-3

Git Clone URL: https://aur.archlinux.org/cdecl.git (read-only, click to copy)
Package Base: cdecl
Description: Translation between C declarations and pseudo-English
Upstream URL: http://www.ibiblio.org/pub/linux/devel/lang/c/
Licenses: Public Domain
Submitter: galdor
Maintainer: aksr
Last Packager: aksr
Votes: 36
Popularity: 0.000000
First Submitted: 2008-07-02 09:53 (UTC)
Last Updated: 2015-07-16 14:52 (UTC)

Latest Comments

1 2 Next › Last »

tirsek commented on 2026-02-21 05:11 (UTC) (edited on 2026-02-21 05:13 (UTC) by tirsek)

Trying to build this version of cdecl against modern libreadline causes more problems. First of all, the completion interface that cdecl uses is deprecated and parts of what's needed is now hidden behind an #if 0 block in the readline headers, and more importantly, this causes a segmentation fault when trying to use completion, at least on x86-64. I did write a patch (included below) that fixes it, but overall it's probably time to ditch this package in favor of cdecl-pjl or cdecl-pjl-git instead.

Since the PKGBUILD hasn't been updated to fix the last problem almost 7 years ago, I doubt this will get included either, but in case it's useful to anyone, I'm including my patch here:

diff --git a/cdecl-2.5/cdecl.c b/cdecl-2.5/cdecl.c
index e01f8fa..a5bce73 100644
--- a/cdecl-2.5/cdecl.c
+++ b/cdecl-2.5/cdecl.c
@@ -91,9 +91,9 @@ void free(), exit(), perror();
 # include <readline/readline.h>
   /* prototypes for functions related to readline() */
   char * our_getline(void);
-  char ** attempt_completion(char *, int, int);
-  char * keyword_completion(char *, int);
-  char * command_completion(char *, int);
+  char ** attempt_completion(const char *, int, int);
+  char * keyword_completion(const char *, int);
+  char * command_completion(const char *, int);
 #endif

 /* maximum # of chars from progname to display in prompt */
@@ -394,16 +394,16 @@ char * our_getline (void)
   return (line_read);
 }

-char ** attempt_completion(char *text, int start, int end)
+char ** attempt_completion(const char *text, int start, int end)
 {
   char **matches = NULL;

-  if (start == 0) matches = completion_matches(text, command_completion);
+  if (start == 0) matches = rl_completion_matches(text, command_completion);

   return matches;
 }

-char * command_completion(char *text, int flag)
+char * command_completion(const char *text, int flag)
 {
   static int index, len;
   char *command;
@@ -420,7 +420,7 @@ char * command_completion(char *text, int flag)
   return NULL;
 }

-char * keyword_completion(char *text, int flag)
+char * keyword_completion(const char *text, int flag)
 {
   static int index, len, set, into;
   char *keyword, *option;
@@ -1250,8 +1250,8 @@ char **argv;

 #ifdef USE_READLINE
     /* install completion handlers */
-    rl_attempted_completion_function = (CPPFunction *)attempt_completion;
-    rl_completion_entry_function = (Function *)keyword_completion;
+    rl_attempted_completion_function = attempt_completion;
+    rl_completion_entry_function = keyword_completion;
 #endif

     setprogname(argv[0]);

And my copy of the PKGBUILD is now changed as follows:

diff --git a/PKGBUILD b/PKGBUILD
index 6e71f76..a4fd0b1 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -13,30 +13,38 @@ depends=('readline')
 source=("http://www.ibiblio.org/pub/linux/devel/lang/c/$pkgname-$pkgver.tar.gz"
         'getopt.patch'
         'makefile.patch'
-        'fix-getline.patch')
+        'fix-getline.patch'
+        'fix-readline.patch')
 md5sums=('29895dab52e85b2474a59449e07b7996'
          'bd0889f5c6142b46f667700ebf0eda02'
          '3a2a766cdc3fdc714ba35655d4d836a9'
-         'df27d358e2e603609adf3e6165b74afe')
+         'df27d358e2e603609adf3e6165b74afe'
+         '66ad43733ed667c912a0c7b5c201ab0a'
+)
 sha1sums=('b955a0b95b635090360b19de888cb29d5c005296'
           '1d2dfca8664d5f510fbd63bf35cb35bbe448778d'
           '3fbb41c890813e80ddc11d95dff0a00cbfc5a3f8'
-          '2b046c946dbeab168e26d0f5a99bbb12afe3fe27')
+          '2b046c946dbeab168e26d0f5a99bbb12afe3fe27'
+          '5cde2c4f101cbb91cf14a973b5eaaee5c8795f81'
+)
 sha256sums=('b74caef08407a2195d6f1facf103e5af29253f67d599486164241b14ee42a936'
             'e81af13a029c27b6c38a2041b15b1e2f236286361bddbb367034eb7b48186cd0'
             'f61a2e1387479c408a3af9897de514e4a420409677ff3a234fd403ad0a607d2a'
-            'f8676cfff24ddff71d5d7f737d7a6612573c28d63d99385697812af6352312db')
+            'f8676cfff24ddff71d5d7f737d7a6612573c28d63d99385697812af6352312db'
+            'aa9a4d4e9af8129bedc304afa11c2011adbddd19992c06429cd92394f5f00ea7'
+)

 prepare() {
   cd "$srcdir/$pkgname-$pkgver"
   patch -Np1 -i "$srcdir/getopt.patch"
   patch -Np1 -i "$srcdir/makefile.patch"
   patch -Np1 -i "$srcdir/fix-getline.patch"
+  patch -Np2 -i "$srcdir/fix-readline.patch"
 }

 build() {
   cd "$srcdir/$pkgname-$pkgver"
-  make CFLAGS="-std=gnu90"
+  make CFLAGS="-O2 -g -DUSE_READLINE -std=gnu90"
 }

 package() {

tirsek commented on 2019-07-09 14:04 (UTC)

Setting CFLAGS when calling make from PKGBUILD completely replaces the CFLAGS defined in the Makefile, which results in the package being build without readline support.

We should probably add the original CFLAGS contents to the PKGBUILD:

diff --git a/PKGBUILD b/PKGBUILD
index 6e71f76..532f854 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -36,7 +36,7 @@ prepare() {

 build() {
   cd "$srcdir/$pkgname-$pkgver"
-  make CFLAGS="-std=gnu90"
+  make CFLAGS="-O2 -s -DUSE_READLINE -std=gnu90"
 }

 package() {

aksr commented on 2015-07-16 14:54 (UTC)

jarmar: Thanks, fixed.

jarmar commented on 2015-07-16 12:39 (UTC)

I'm getting the following error (and a few more on the same subject) when trying to build: cdecl.c: In function ‘mbcheck’: cdecl.c:243:24: error: expected identifier or ‘(’ before ‘restrict’ register int i, j, restrict; ^ This is likely due to gcc changing the default standard from gnu90 to gnu11 in version 5.1, making restrict a reserved word. Adding -std=gnu90 to CFLAGS made it build properly for me.

cb73 commented on 2015-01-23 21:44 (UTC)

I'm getting the following error when trying to build this package: ==> Building and installing package ==> ERROR: Missing package() function in /tmp/yaourt-tmp-claudio/aur-cdecl/./PKGBUILD ==> ERROR: Makepkg was unable to build cdecl. I had split the make install out of the build() function into the package() function and it worked.

<deleted-account> commented on 2011-04-14 14:16 (UTC)

I replaced the ftp link with http://www.ibiblio.org. Works well now! Thanks for your report.

<deleted-account> commented on 2011-04-14 14:09 (UTC)

There seems to be a problem with metalab's ftp server. I get "connection refused" when opening the PASV data connection. I'll keep investigating; maybe I can find a better source link.

vojtechkral commented on 2011-04-14 13:46 (UTC)

Is it just me or is the source link dead?

<deleted-account> commented on 2010-09-05 19:42 (UTC)

Ok, thanks! I updated it.