[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 3/3] setenv: allow compilation with C++
From: |
Eric Blake |
Subject: |
[PATCH 3/3] setenv: allow compilation with C++ |
Date: |
Fri, 16 Apr 2010 15:53:43 -0600 |
* lib/setenv.c (__add_to_environ): Add a cast. Also, drop use of
register keyword.
Signed-off-by: Eric Blake <address@hidden>
---
ChangeLog | 4 ++++
lib/setenv.c | 6 +++---
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2a3f017..2360f0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2010-04-16 Eric Blake <address@hidden>
+ setenv: allow compilation with C++
+ * lib/setenv.c (__add_to_environ): Add a cast. Also, drop use of
+ register keyword.
+
stdint: allow test to pass with C++
* tests/test-stdint.c: Define __STDC_CONSTANT_MACROS, for glibc.
diff --git a/lib/setenv.c b/lib/setenv.c
index b4c5532..ee9da0d 100644
--- a/lib/setenv.c
+++ b/lib/setenv.c
@@ -112,8 +112,8 @@ int
__add_to_environ (const char *name, const char *value, const char *combined,
int replace)
{
- register char **ep;
- register size_t size;
+ char **ep;
+ size_t size;
const size_t namelen = strlen (name);
const size_t vallen = value != NULL ? strlen (value) + 1 : 0;
@@ -249,7 +249,7 @@ __add_to_environ (const char *name, const char *value,
const char *combined,
if (np == NULL)
#endif
{
- np = malloc (namelen + 1 + vallen);
+ np = (char *) malloc (namelen + 1 + vallen);
if (np == NULL)
{
#if defined USE_TSEARCH && !defined _LIBC
--
1.6.6.1
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Joel E. Denny, 2010/04/15
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Eric Blake, 2010/04/15
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Bruno Haible, 2010/04/15
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Paolo Bonzini, 2010/04/16
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Bruno Haible, 2010/04/16
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Eric Blake, 2010/04/16
- [PATCH 0/3] several C++ patches, Eric Blake, 2010/04/16
- [PATCH 2/3] stdint: allow test to pass with C++, Eric Blake, 2010/04/16
- [PATCH 1/3] getopt: allow compilation with C++, Eric Blake, 2010/04/16
- [PATCH 3/3] setenv: allow compilation with C++,
Eric Blake <=
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Joel E. Denny, 2010/04/20
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Dagobert Michelsen, 2010/04/20
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Eric Blake, 2010/04/20
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Joel E. Denny, 2010/04/20
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Eric Blake, 2010/04/20
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Joel E. Denny, 2010/04/20
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Paolo Bonzini, 2010/04/21
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Joel E. Denny, 2010/04/22
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Dagobert Michelsen, 2010/04/25
- Re: [GNU Bison 2.4.2] testsuite: Failing tests of bison 2.4.2 on Solaris 8+9 w/Sun Studio 11+12, Bruno Haible, 2010/04/25