Opened 6 months ago

Last modified 4 weeks ago

#71632 assigned defect

boost176 @1.76.0_12: error: expected identifier before '(' token

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version: 2.10.5
Keywords: tiger ppc Cc: mascguy (Christopher Nielsen), cooljeanius (Eric Gallager)
Port: boost176

Description

...failed updating 2 targets...
...skipped 93 targets...
...updated 489 targets...
Command failed:  cd "/opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_boost176/boost176/work/boost_1_76_0" && /opt/local/var/macports/build/nue.de.rsync.macports.org_macports_release_tarballs_ports_devel_boost176/boost176/work/boost_1_76_0/b2 -d2 --layout=tagged --debug-configuration --user-config=user-config.jam -sBZIP2_INCLUDE=/opt/local/include -sBZIP2_LIBPATH=/opt/local/lib -sEXPAT_INCLUDE=/opt/local/include -sEXPAT_LIBPATH=/opt/local/lib -sZLIB_INCLUDE=/opt/local/include -sZLIB_LIBPATH=/opt/local/lib -sICU_PATH=/opt/local variant=release runtime-link=shared -j1 --no-cmake-config architecture=power --disable-long-double link=shared threading=multi 

is the end. The errors happen before:

    "/opt/local/bin/g++-mp-14"   -fvisibility-inlines-hidden -Os -std=gnu++17 -Wno-enum-constexpr-conversion -Wno-unknown-warning-option -D__DARWIN_UNIX03=1 -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc  -fPIC -m32 -O3 -Wall -fvisibility=hidden -dynamic -gdwarf-2 -fexceptions -Wno-inline  -DBOOST_ALL_NO_LIB=1 -DBOOST_CHRONO_DYN_LINK=1 -DBOOST_LOCALE_DYN_LINK=1 -DBOOST_LOCALE_NO_WINAPI_BACKEND=1 -DBOOST_LOCALE_WITH_ICONV=1 -DBOOST_LOCALE_WITH_ICU=1 -DBOOST_SYSTEM_DYN_LINK=1 -DBOOST_THREAD_BUILD_DLL=1 -DBOOST_THREAD_NO_LIB=1 -DBOOST_THREAD_POSIX -DBOOST_THREAD_USE_DLL=1 -DNDEBUG  -I"." -I"/opt/local/include"  -c -o "bin.v2/libs/locale/build/darwin-14.2.0/release/threadapi-pthread/threading-multi/visibility-hidden/shared/mo_lambda.o" "libs/locale/src/shared/mo_lambda.cpp"

In file included from /usr/include/_wctype.h:78,
                 from /usr/include/wchar.h:115,
                 from /opt/local/include/gcc14/c++/cwchar:44,
                 from /opt/local/include/gcc14/c++/bits/postypes.h:40,
                 from /opt/local/include/gcc14/c++/iosfwd:42,
                 from /opt/local/include/gcc14/c++/bits/shared_ptr.h:52,
                 from /opt/local/include/gcc14/c++/memory:80,
                 from ./boost/smart_ptr/detail/sp_counted_impl.hpp:35,
                 from ./boost/smart_ptr/detail/shared_count.hpp:27,
                 from ./boost/smart_ptr/shared_ptr.hpp:17,
                 from ./boost/shared_ptr.hpp:17,
                 from libs/locale/src/shared/mo_lambda.hpp:11,
                 from libs/locale/src/shared/mo_lambda.cpp:8:
libs/locale/src/shared/mo_lambda.cpp:257:14: error: expected identifier before '(' token
  257 |         bool isdigit(char c)
      |              ^~~~~~~
libs/locale/src/shared/mo_lambda.cpp:257:14: error: expected identifier before numeric constant
  257 |         bool isdigit(char c)
      |              ^~~~~~~
libs/locale/src/shared/mo_lambda.cpp:257:14: error: expected ',' or '...' before numeric constant
libs/locale/src/shared/mo_lambda.cpp: In member function 'bool boost::locale::gnu_gettext::lambda::{anonymous}::tokenizer::__isctype(int (*)(char), int)':
libs/locale/src/shared/mo_lambda.cpp:259:25: error: 'c' was not declared in this scope
  259 |             return '0'<=c && c<='9';
      |                         ^
libs/locale/src/shared/mo_lambda.cpp: In member function 'void boost::locale::gnu_gettext::lambda::{anonymous}::tokenizer::step()':
libs/locale/src/shared/mo_lambda.cpp:275:29: error: invalid conversion from 'char' to 'int (*)(char)' [-fpermissive]
  275 |             else if(isdigit(*ptr)) { int_value=strtol(text+pos,&tmp_ptr,0); pos=tmp_ptr-text; next_tocken=NUM; }
      |                             ^
      |                             |
      |                             char
libs/locale/src/shared/mo_lambda.cpp:257:14: note:   initializing argument 1 of 'bool boost::locale::gnu_gettext::lambda::{anonymous}::tokenizer::__isctype(int (*)(char), int)'
  257 |         bool isdigit(char c)
      |              ^~~~~~~
At global scope:
cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-enum-constexpr-conversion' may have been intended to silence earlier diagnostics
...failed darwin.compile.c++ bin.v2/libs/locale/build/darwin-14.2.0/release/threadapi-pthread/threading-multi/visibility-hidden/shared/mo_lambda.o...
common.mkdir bin.v2/libs/locale/build/darwin-14.2.0/release/threadapi-pthread/threading-multi/visibility-hidden/util
    "/opt/local/bin/g++-mp-14" -x c++-header -fvisibility-inlines-hidden -Os -std=gnu++17 -Wno-enum-constexpr-conversion -Wno-unknown-warning-option -D__DARWIN_UNIX03=1 -D_GLIBCXX_USE_CXX11_ABI=0 -arch ppc  -fPIC -m32 -O3 -Wall -fvisibility=hidden -dynamic -gdwarf-2 -fexceptions -Wno-inline  -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/pch/darwin-14.2.0/release/threading-multi/visibility-hidden/../src/tr1/pch.hpp.gch" "libs/math/build/../src/tr1/pch.hpp"

In file included from ./boost/math/tools/mp.hpp:341,
                 from ./boost/math/policies/policy.hpp:11,
                 from ./boost/math/special_functions/math_fwd.hpp:31,
                 from ./boost/math/special_functions/airy.hpp:11,
                 from ./boost/math/special_functions.hpp:15,
                 from libs/math/build/../src/tr1/pch.hpp:9:
/opt/local/include/gcc14/c++/utility:108:14: error: '__and_' was not declared in this scope; did you mean 'std::__and_'?
  108 |     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
      |              ^~~~~~
      |              std::__and_
In file included from /opt/local/include/gcc14/c++/bits/stl_pair.h:60,
                 from /opt/local/include/gcc14/c++/bits/stl_algobase.h:64,
                 from /opt/local/include/gcc14/c++/vector:62,
                 from ./boost/math/special_functions/math_fwd.hpp:26:
/opt/local/include/gcc14/c++/type_traits:198:12: note: 'std::__and_' declared here
  198 |     struct __and_
      |            ^~~~~~
/opt/local/include/gcc14/c++/utility:108:21: error: 'is_nothrow_move_constructible' was not declared in this scope; did you mean 'std::is_nothrow_move_constructible'?
  108 |     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                     std::is_nothrow_move_constructible
/opt/local/include/gcc14/c++/type_traits:1210:12: note: 'std::is_nothrow_move_constructible' declared here
 1210 |     struct is_nothrow_move_constructible
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/gcc14/c++/utility:108:54: error: expected primary-expression before '>' token
  108 |     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
      |                                                      ^
/opt/local/include/gcc14/c++/utility:108:55: error: expected primary-expression before ',' token
  108 |     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
      |                                                       ^
/opt/local/include/gcc14/c++/utility:108:55: error: expected ')' before ',' token
  108 |     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
      |             ~                                         ^
      |                                                       )
/opt/local/include/gcc14/c++/utility:108:55: error: expected ';' before ',' token
  108 |     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
      |                                                       ^
      |                                                       ;
/opt/local/include/gcc14/c++/utility:116:15: error: 'add_const_t' does not name a type
  116 |     constexpr add_const_t<_Tp>&
      |               ^~~~~~~~~~~
./boost/math/tools/mp.hpp:342:10: error: 'boost::math::tools::meta_programming::std::size_t' has not been declared
  342 | template<std::size_t... I>
      |          ^~~
./boost/math/tools/mp.hpp:343:29: error: 'index_sequence' in namespace 'boost::math::tools::meta_programming::std' does not name a template type
  343 | using index_sequence = std::index_sequence<I...>;
      |                             ^~~~~~~~~~~~~~
./boost/math/tools/mp.hpp:345:10: error: 'boost::math::tools::meta_programming::std::size_t' has not been declared
  345 | template<std::size_t N>
      |          ^~~
./boost/math/tools/mp.hpp:346:34: error: 'make_index_sequence' in namespace 'boost::math::tools::meta_programming::std' does not name a template type
  346 | using make_index_sequence = std::make_index_sequence<N>;
      |                                  ^~~~~~~~~~~~~~~~~~~
./boost/math/tools/mp.hpp:349:33: error: 'index_sequence_for' in namespace 'boost::math::tools::meta_programming::std' does not name a template type
  349 | using index_sequence_for = std::index_sequence_for<T...>;
      |                                 ^~~~~~~~~~~~~~~~~~
cc1plus: note: unrecognized command-line option '-Wno-unknown-warning-option' may have been intended to silence earlier diagnostics
cc1plus: note: unrecognized command-line option '-Wno-enum-constexpr-conversion' may have been intended to silence earlier diagnostics
...failed darwin.compile.c++.pch bin.v2/libs/math/build/pch/darwin-14.2.0/release/threading-multi/visibility-hidden/../src/tr1/pch.hpp.gch...

Can poppler use boost178 as well? It has a variant +boost without any digits…

Attachments (3)

main.log (1.1 MB) - added by ballapete (Peter "Pete" Dyballa) 6 months ago.
Main.log from PPC Tiger, Mac OS X 10.4.11
boost171-fail-tiger-ppc.log (2.5 MB) - added by kencu (Ken) 6 months ago.
boost171 fail with gcc-14 on Tiger PPC
boost171-fail-tigerppc-gcc10.log (731.9 KB) - added by kencu (Ken) 6 months ago.
boost171 fail with gcc-10 on Tiger PPC

Change History (11)

Changed 6 months ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Tiger, Mac OS X 10.4.11

comment:1 Changed 6 months ago by ballapete (Peter "Pete" Dyballa)

Summary: boost176 @1.76.0_12 does not configure on PPC Mac OS X 10.4.11, Tiger, because "command execution failed"?boost176 @1.76.0_12 does not build on PPC Mac OS X 10.4.11, Tiger, because "command execution failed"?

boost178 has the same failure as #71633, #71634, #71635, #71636, #71637, and #71638:

Error: clang-11-bootstrap cannot be installed for the configured build_arch 'ppc' because it only supports the arch(s) 'arm64 i386 x86_64'.
Error: Problem while installing clang-11-bootstrap
Last edited 6 months ago by ballapete (Peter "Pete" Dyballa) (previous) (diff)

comment:2 Changed 6 months ago by ballapete (Peter "Pete" Dyballa)

boost178 has the same failure.

comment:3 Changed 6 months ago by kencu (Ken)

boost171 has the same failure.

Changed 6 months ago by kencu (Ken)

Attachment: boost171-fail-tiger-ppc.log added

boost171 fail with gcc-14 on Tiger PPC

Changed 6 months ago by kencu (Ken)

boost171 fail with gcc-10 on Tiger PPC

comment:4 Changed 6 months ago by kencu (Ken)

ChatGPT's take:

The error in your build log indicates a conflict with the isdigit function. The issue arises because isdigit is already defined in the standard C library (<ctype.h> or <cwctype>), causing a naming conflict with your custom isdigit implementation in libs/locale/src/shared/mo_lambda.cpp.

Here's a breakdown of the issues and potential solutions:

Problem Explanation
Conflict with Standard Library Functionality:
isdigit is a standard library function that determines if a character is a digit. Your code redefines isdigit, causing ambiguity during compilation.
Scope and Declaration Issues:
The compiler interprets calls to isdigit ambiguously since it cannot distinguish between the custom implementation and the standard library function.
Compilation Errors:
bool isdigit(char c) conflicts with the standard isdigit(int) function.
Usage of isdigit(*ptr) attempts to pass a char to a function expecting a different type, exacerbating the issue.
Solutions
1. Rename Your Custom isdigit Function

Rename the conflicting function to avoid the name clash:

bool is_custom_digit(char c) {
    return '0' <= c && c <= '9';
}
Update all references in mo_lambda.cpp to use is_custom_digit instead of isdigit.

2. Explicit Namespace Usage

Wrap your custom isdigit function in a unique namespace to prevent conflicts:

namespace custom {
    bool isdigit(char c) {
        return '0' <= c && c <= '9';
    }
}
Call it explicitly using custom::isdigit(*ptr).

3. Include <ctype.h> or <cwctype> Before Your Code

To ensure proper resolution of the standard library function, explicitly include the required headers:

#include <ctype.h>
Then, ensure your function does not interfere by renaming it or qualifying its usage.

4. Use the Standard Library Function

If your custom isdigit function performs the same operation as the standard library function, consider using the standard isdigit(int c) directly. Note that it expects an int and may require casting:

if (isdigit(static_cast<unsigned char>(*ptr))) { 
    int_value = strtol(text + pos, &tmp_ptr, 0); 
    pos = tmp_ptr - text; 
    next_token = NUM;
}
5. Guard Against Macro Conflicts

If isdigit is being replaced by a macro in some headers, undefine it after inclusion:

#include <ctype.h>
#undef isdigit
Action Plan
Search for all usages of isdigit in mo_lambda.cpp.
Apply one of the above solutions to resolve the naming conflict.
Rebuild the project to ensure the issue is resolved.
Would you like help implementing a specific solution or further clarification on any of the steps?

comment:5 Changed 6 months ago by ryandesign (Ryan Carsten Schmidt)

Cc: mascguy added; michaelld@… mascguy@… removed
Owner: set to michaelld
Status: newassigned
Summary: boost176 @1.76.0_12 does not build on PPC Mac OS X 10.4.11, Tiger, because "command execution failed"?boost176 @1.76.0_12: error: expected identifier before '(' token

Replying to kencu:

Solutions
1. Rename Your Custom isdigit Function

Rename the conflicting function to avoid the name clash:

bool is_custom_digit(char c) {
    return '0' <= c && c <= '9';
}
Update all references in mo_lambda.cpp to use is_custom_digit instead of isdigit.

Upstream fixed the problem in 1.83.0 by renaming its isdigit function to is_digit.

Last edited 6 months ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:6 in reply to:  5 Changed 6 months ago by mascguy (Christopher Nielsen)

Replying to ryandesign:

Upstream fixed the problem in 1.83.0 by renaming its isdigit function to is_digit.

Unfortunately it looks like the source file in question has gone through multiple iterations, such that we can't use the patch as-is. Even for 1.81, only two of the five hunks succeed. And for 1.78 and earlier, none of the hunks do. Sigh.

So I'll need to scrutinize the changes more closely, to see if it's possible to make a minimal change. Otherwise we may need to try an alternative approach.

comment:7 Changed 6 months ago by kencu (Ken)

I thought I'd try building it with gcc7, however ran into our soon-to-be-old friend:

    "/opt/local/bin/g++-mp-7" -dynamiclib -Wl,-single_module -install_name "/opt/local/libexec/boost/1.71/lib/libboost_log_setup-mt.dylib" -L"/opt/local/bin" -L"/opt/local/lib" -o "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_log_setup-mt.dylib" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/parser_utils.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/init_from_stream.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/init_from_settings.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/settings_parser.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/filter_parser.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/formatter_parser.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/default_filter_factory.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/matches_relation_factory.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/setup/default_formatter_factory.o" "bin.v2/libs/log/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_log-mt.dylib" "bin.v2/libs/regex/build/darwin-7.5.0/release/threading-multi/visibility-hidden/libboost_regex-mt.dylib" "bin.v2/libs/filesystem/build/darwin-7.5.0/release/threading-multi/visibility-hidden/libboost_filesystem-mt.dylib" "bin.v2/libs/thread/build/darwin-7.5.0/release/threadapi-pthread/threading-multi/visibility-hidden/libboost_thread-mt.dylib" "bin.v2/libs/date_time/build/darwin-7.5.0/release/threading-multi/visibility-hidden/libboost_date_time-mt.dylib" "bin.v2/libs/chrono/build/darwin-7.5.0/release/threading-multi/visibility-hidden/libboost_chrono-mt.dylib" "bin.v2/libs/atomic/build/darwin-7.5.0/release/threading-multi/visibility-hidden/libboost_atomic-mt.dylib"  -licudata -licui18n -licuuc    -headerpad_max_install_names -fPIC -m32 -fvisibility=hidden -fvisibility-inlines-hidden -Wl,-dead_strip -no_dead_strip_inits_and_terms -L/opt/local/lib -Wl,-headerpad_max_install_names  -arch ppc 

Undefined symbols:
  "std::basic_ostream<char, std::char_traits<char> >& std::basic_ostream<char, std::char_traits<char> >::_M_insert<long double>(long double)", referenced from:
      void boost::log::v2_mt_posix::type_dispatcher::callback_base::trampoline<boost::log::v2_mt_posix::aux::(anonymous namespace)::default_formatter<char>::visitor, long double>(void*, long double const&) in default_formatter_factory.o
  "typeinfo for long double", referenced from:
      __ZTIe$non_lazy_ptr in default_filter_factory.o
     (maybe you meant: __ZTIe$non_lazy_ptr)
  "std::basic_ostream<wchar_t, std::char_traits<wchar_t> >& std::basic_ostream<wchar_t, std::char_traits<wchar_t> >::_M_insert<long double>(long double)", referenced from:
      void boost::log::v2_mt_posix::type_dispatcher::callback_base::trampoline<boost::log::v2_mt_posix::aux::(anonymous namespace)::default_formatter<wchar_t>::visitor, long double>(void*, long double const&) in default_formatter_factory.o
ld: symbol(s) not found
collect2: error: ld returned 1 exit status

comment:8 Changed 4 weeks ago by cooljeanius (Eric Gallager)

Cc: cooljeanius added
Note: See TracTickets for help on using tickets.