[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug-gnulib] Add strdup.h.
From: |
Simon Josefsson |
Subject: |
[Bug-gnulib] Add strdup.h. |
Date: |
Sun, 18 Jan 2004 08:58:59 +0100 |
User-agent: |
Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux) |
I get warnings when building with -ansi -pedantic, because there is no
prototype for strdup. I imagine calling strdup without a prototype
might not work portably, because it would cast a 'char*' into 'int'
(function call) and back to 'char*' (assignment), but I'm not sure.
There is a warning though.
2004-01-18 Simon Josefsson <address@hidden>
* modules/strdup (Files, Makefile.am): Add strdup.h.
Index: strdup
===================================================================
RCS file: /cvsroot/gnulib/gnulib/modules/strdup,v
retrieving revision 1.3
diff -u -p -u -w -r1.3 strdup
--- strdup 20 Jan 2003 10:02:38 -0000 1.3
+++ strdup 18 Jan 2004 07:53:51 -0000
@@ -2,6 +2,7 @@ Description:
strdup() function: duplicate a string.
Files:
+lib/strdup.h
lib/strdup.c
m4/strdup.m4
@@ -11,6 +12,7 @@ configure.ac:
gl_FUNC_STRDUP
Makefile.am:
+lib_SOURCES += strdup.h
Include:
2004-01-18 Simon Josefsson <address@hidden>
* strdup.h: Add.
Index: strdup.h
===================================================================
RCS file: strdup.h
diff -N strdup.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ strdup.h 18 Jan 2004 07:54:34 -0000
@@ -0,0 +1,2 @@
+/* Duplicate S, returning an identical malloc'd string. */
+char *strdup (const char *s);