bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnulib] automatic prototypes


From: Simon Josefsson
Subject: [bug-gnulib] automatic prototypes
Date: Thu, 16 Dec 2004 02:55:34 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

This might be controversial, but thought I'd bring it up anyway...

Adding '#include "strdup.h"' to my source code decreases readability.

It feels silly to be able to use 'inline', 'restrict' etc without
doing anything, but not be able to use strdup without including a
header file.

So how about a patch like the below?  Then my code only have to
#include "config.h" to get a strdup prototype.

I guess the controversial aspect is putting too much things into
config.h...  I'm envisioning a future gnulib where everything that is
part of a GNU system (getline, error, ...) is automatically made
visible to projects, via config.h, using this approach.  Such a
config.h will likely be large and non-trivial.

Thanks.

--- strdup.m4   29 Sep 2004 00:41:13 +0200      1.4
+++ strdup.m4   16 Dec 2004 02:47:47 +0100      
@@ -10,6 +10,12 @@
 [
   AC_REPLACE_FUNCS(strdup)
   AC_CHECK_DECLS_ONCE(strdup)
+  AH_BOTTOM([
+#if defined HAVE_DECL_STRDUP && !HAVE_DECL_STRDUP
+/* Duplicate S, returning an identical malloc'd string.  */
+extern char *strdup (const char *s);
+#endif
+])
   gl_PREREQ_STRDUP
 ])
 





reply via email to

[Prev in Thread] Current Thread [Next in Thread]