gnuastro-devel
[Top][All Lists]
Advanced

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

[gnuastro-devel] [bug #49007] Gnulib C headers not allowing C++ compilat


From: Mohammad Akhlaghi
Subject: [gnuastro-devel] [bug #49007] Gnulib C headers not allowing C++ compilation in tests
Date: Mon, 5 Sep 2016 09:14:18 +0000 (UTC)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0

URL:
  <http://savannah.gnu.org/bugs/?49007>

                 Summary: Gnulib C headers not allowing C++ compilation in
tests
                 Project: GNU Astronomy Utilities
            Submitted by: makhlaghi
            Submitted on: Mon 05 Sep 2016 06:14:16 PM JST
                Category: Installation
                Severity: 4 - Important
              Item Group: Crash
                  Status: Confirmed
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

As part of task #13786, a test was written to compile a simple C++ program, it
worked on my GNU/Linux system, but a friend of mine who tested it on a Mac
came up with the following errors when running `make check'.



g++ -DHAVE_CONFIG_H -I. -I..   -DSYSCONFIG_DIR=\"/usr/local/etc\" -I../lib
-I../bootstrapped/lib -I/usr/local/include  -g -O2 -MT lib/versioncpp.o -MD
-MP -MF $depbase.Tpo -c -o lib/versioncpp.o lib/versioncpp.cpp &&\

mv -f $depbase.Tpo $depbase.Po

In file included from lib/versioncpp.cpp:24:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:436:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cstring:61:

*../bootstrapped/lib/string.h:498:35: **error: **expected ')'*

                  (void *restrict __dest, void const *restrict __src,

*                                  ^*

*../bootstrapped/lib/string.h:498:19: note: *to match this '('

                  (void *restrict __dest, void const *restrict __src,

*                  ^*

*../bootstrapped/lib/string.h:500:19: **error: **'__nonnull__' attribute
parameter 2*

*      is out of bounds*

                  _GL_ARG_NONNULL ((1, 2)));

*                  ^                    ~*

*../bootstrapped/lib/stdlib.h:382:51: note: *expanded from macro
'_GL_ARG_NONNULL'

#  define _GL_ARG_NONNULL(params) __attribute__ ((__nonnull__ params))

*                                                  ^           ~~~~~~*

*../bootstrapped/lib/stdlib.h:210:29: note: *expanded from macro

      '_GL_FUNCDECL_SYS'

  _GL_EXTERN_C rettype func parameters_and_attributes

*                            ^~~~~~~~~~~~~~~~~~~~~~~~~*

In file included from lib/versioncpp.cpp:24:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:438:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:107:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype:55:

*../bootstrapped/lib/wctype.h:66:3: **error: **"Please include config.h
first."*

 #error "Please include config.h first."

*  ^*

*../bootstrapped/lib/wctype.h:68:1: **error: **unknown type name*

*      '_GL_INLINE_HEADER_BEGIN'*

_GL_INLINE_HEADER_BEGIN

*^*

*../bootstrapped/lib/wctype.h:692:1: **error: **expected unqualified-id*

_GL_CXXALIAS_SYS (iswalnum, int, (wint_t wc));

*^*

*../bootstrapped/lib/stdlib.h:272:5: note: *expanded from macro
'_GL_CXXALIAS_SYS'

    _GL_EXTERN_C int _gl_cxxalias_dummy

*    ^*

*../bootstrapped/lib/stdlib.h:185:23: note: *expanded from macro
'_GL_EXTERN_C'

# define _GL_EXTERN_C extern "C"

*                      ^*

In file included from lib/versioncpp.cpp:24:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:438:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:107:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype:55:

*../bootstrapped/lib/wctype.h:813:1: **error: **unknown type name*

*      '_GL_INLINE_HEADER_END'*

_GL_INLINE_HEADER_END

*^*

In file included from lib/versioncpp.cpp:24:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/iostream:38:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/ios:216:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__locale:15:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:438:

In file included from
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwchar:107:

*/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cwctype:61:1:
**error: *

*      expected unqualified-id*

_LIBCPP_BEGIN_NAMESPACE_STD

*^*

*/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__config:385:37:
note: *

      expanded from macro '_LIBCPP_BEGIN_NAMESPACE_STD'

#define _LIBCPP_BEGIN_NAMESPACE_STD namespace std {inline namespace _LIB...

*                                    ^*

7 errors generated.

make[3]: *** [lib/versioncpp.o] Error 1


The error is apparently due to the fact that his system is looking into the
bootstrapped Gnulib C headers (for example `../bootstrapped/lib/string.h' in
the first case), when it is compiling the C++ `versioncpp.cpp' code. 

When building actual Gnuastro code, we need to include the Gnulib libraries
before the system libraries, so we have the `../bootstrapped/lib' directories
in `CPPFLAGS'. However, this is not the case for tests, we want the tests to
completely use the system's resources (since we won't be installing Gnulib).

By explicitly setting `CPPFLAGS' in `tests/Makefile.am' as shown below, the
problem on his system was solved and it successfully built `versioncpp'.


CPPFLAGS = -I$(top_srcdir)/lib


But this can't be a permanent solution, since we are practically over-writing
this important user-defined variable. 




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?49007>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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