[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: status of new 'c++defs' module?
From: |
Bruno Haible |
Subject: |
Re: status of new 'c++defs' module? |
Date: |
Sat, 13 Mar 2010 16:24:13 +0100 |
User-agent: |
KMail/1.9.9 |
Hi John,
> OK, I tried updating and using the new c++defs module and hit an
> error with memchr and memrchr.
> ...
> In file included from /usr/include/c++/4.4/cstring:46,
> from /home/jwe/src/octave/liboctave/foo.cc:3:
> ../libgnu/string.h:298: error: no matches converting function 'memchr' to
> type 'void* (*)(const void*, int, size_t)'
> /usr/include/string.h:74: error: candidates are: void* memchr(void*, int,
> size_t)
> /usr/include/string.h:76: error: const void* memchr(const
> void*, int, size_t)
> ../libgnu/string.h:301: error: type of 'memchr' is unknown
> ../libgnu/string.h:301: error: invalid type in declaration before ';' token
> ../libgnu/string.h:301: error: 'int memchr' redeclared as different kind of
> symbol
> /usr/include/string.h:76: error: previous declaration of 'const void*
> memchr(const void*, int, size_t)'
> In file included from /usr/include/c++/4.4/cstring:46,
> from /home/jwe/src/octave/liboctave/foo.cc:3:
> ../libgnu/string.h:371: error: no matches converting function 'memrchr' to
> type 'void* (*)(const void*, int, size_t)'
> /usr/include/string.h:114: error: candidates are: void* memrchr(void*, int,
> size_t)
> /usr/include/string.h:116: error: const void* memrchr(const
> void*, int, size_t)
> ../libgnu/string.h:372: error: type of 'memrchr' is unknown
> In file included from /usr/include/c++/4.4/cstring:46,
> from /home/jwe/src/octave/liboctave/foo.cc:3:
> ../libgnu/string.h:372: error: invalid type in declaration before ';' token
> ../libgnu/string.h:372: error: 'int memrchr' redeclared as different kind
> of symbol
> /usr/include/string.h:116: error: previous declaration of 'const void*
> memrchr(const void*, int, size_t)'
I guess that this was the same error that Jim was observing; so I guess it is
fixed now.
> I tried compiling a simple example that just includes two files:
>
> #include <config.h>
> #include <cstring>
Good point. I'm adding this as an extra check in the testsuite:
2010-03-13 Bruno Haible <address@hidden>
Test that gnulib does not break the standard C++ headers.
* tests/test-locale-c++2.cc: New file.
* modules/locale-tests (Files): Add it.
(Makefile.am): Compile it for test-locale-c++.
* tests/test-math-c++2.cc: New file.
* modules/math-tests (Files): Add it.
(Makefile.am): Compile it for test-math-c++.
* tests/test-signal-c++2.cc: New file.
* modules/signal-tests (Files): Add it.
(Makefile.am): Compile it for test-signal-c++.
* tests/test-stdio-c++2.cc: New file.
* modules/stdio-tests (Files): Add it.
(Makefile.am): Compile it for test-stdio-c++.
* tests/test-stdlib-c++2.cc: New file.
* modules/stdlib-tests (Files): Add it.
(Makefile.am): Compile it for test-stdlib-c++.
* tests/test-string-c++2.cc: New file.
* modules/string-tests (Files): Add it.
(Makefile.am): Compile it for test-string-c++.
* tests/test-time-c++2.cc: New file.
* modules/time-tests (Files): Add it.
(Makefile.am): Compile it for test-time-c++.
Reported by John W. Eaton <address@hidden>.
========================== tests/test-string-c++2.cc ==========================
/* Test of <string.h> substitute in C++ mode.
Copyright (C) 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#define GNULIB_NAMESPACE gnulib
#include <config.h>
#include <cstring>