Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boost-1.61.0 failure to bootstrap with xcode-12 due to implicit function declarations #664

Closed
rlei-weta opened this issue Oct 22, 2020 · 5 comments

Comments

@rlei-weta
Copy link

Environment:

  • macOs Catalina 10.15.7
  • Apple clang version 12.0.0

Repro steps:

  1. Download and extract boost-1.61.0 (https://sourceforge.net/projects/boost/files/boost/1.61.0/boost_1_61_0.tar.bz2/download)
  2. Execute ./bootstrap.sh

Error output:

Building Boost.Build engine with toolset darwin... 
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details

bootstrap.log:

###
### Using 'darwin' toolset.
###
rm -rf bootstrap
mkdir bootstrap
cc -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c pathunix.c
execcmd.c:120:5: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    out_printf( "...interrupted\n" );
    ^
1 error generated.
make.c:132:13: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            out_printf( "...found %d target%s...\n", counts->targets,
            ^
make.c:184:17: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                out_printf( "fate change  %s from %s to %s (as dependant of %s)\n",
                ^
make.c:215:17: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                out_printf( "fate change  %s from %s to %s (by rebuild)\n",
                ^
make.c:300:9: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        out_printf( "make\t--\t%s%s\n", spaces( depth ), object_str( t->name ) );
        ^
make.c:300:41: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        out_printf( "make\t--\t%s%s\n", spaces( depth ), object_str( t->name ) );
                                        ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:300:41: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:307:41: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        out_printf( "make\t--\t%s%s\n", spaces( depth ), object_str( t->name ) );
                                        ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:307:41: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:380:49: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            out_printf( "bind\t--\t%s%s: %s\n", spaces( depth ),
                                                ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:380:49: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:388:49: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            out_printf( "time\t--\t%s%s: %s\n", spaces( depth ),
                                                ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:388:49: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:393:49: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            out_printf( "time\t--\t%s%s: %s\n", spaces( depth ),
                                                ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:393:49: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:735:13: error: implicit declaration of function 'out_flush' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            out_flush();
            ^
make.c:758:13: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            spaces( depth ), object_str( t->name ) );
            ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:758:13: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
6 warnings and 5 errors generated.
filesys.c:360:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( archive->members ) )
         ^
filesys.c:496:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) )
         ^
filesys.c:534:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) )
         ^
filesys.c:570:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) ) return list;
         ^
filesys.c:593:11: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( !filelist_empty( list ) ) result = list->size;
          ^
filesys.c:602:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) ) return;
         ^
6 errors generated.
modules/path.c:16:12: error: implicit declaration of function 'file_query' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return file_query( list_front( lol_get( frame->args, 0 ) ) ) ?
           ^
1 error generated.
fileunix.c:233:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( archive->members ) )
         ^
fileunix.c:235:14: error: implicit declaration of function 'file_collect_archive_content_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if ( file_collect_archive_content_( archive ) < 0 )
             ^
fileunix.c:235:14: note: did you mean 'file_collect_dir_content_'?
fileunix.c:110:5: note: 'file_collect_dir_content_' declared here
int file_collect_dir_content_( file_info_t * const d )
    ^
fileunix.c:294:12: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( ! filelist_empty( archive->members ) ) filelist_free( archive->members );
           ^
3 errors generated.

Looks like it is caused by clang bundled with xcode-12 now reporting an error for implicit function declarations:
https://developer.apple.com/documentation/xcode-release-notes/xcode-12-release-notes

Clang now reports an error when you use a function without an explicit declaration when building C or Objective-C code for macOS (-Werror=implicit-function-declaration flag is on). This additional error detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bit targets for this diagnostic. (49917738)

@grafikrobot
Copy link
Member

This was fixed 3 years ago.. 48e9017

Flamefire added a commit to Flamefire/s25client that referenced this issue Dec 18, 2020
Flamefire added a commit to Flamefire/s25client that referenced this issue Dec 18, 2020
Flamefire added a commit to Flamefire/s25client that referenced this issue Dec 18, 2020
Flow86 pushed a commit to Return-To-The-Roots/s25client that referenced this issue Dec 19, 2020
@sv6375261073
Copy link

sv6375261073 commented Nov 30, 2022

Hi everyone,

I'm also facing the same above mentioned issue.
In mac 10.15.7, Xcode: 12.4 & 12.3 with c and cpp 12 version.

I am trying to update boost version to 1.70.0 but get below error.

HUNTER CONFIGURATION:

hunter_config(Boost VERSION 1.70.0)
hunter_config(OpenSSL VERSION 1.0.2n)
hunter_config(PocoCpp VERSION 1.9.0x CMAKE_ARGS ENABLE_NETSSL=ON ENABLE_CRYPTO=ON)
~

[hunter ** FATAL ERROR **] Version not found: 1.70.0. Please check 'hunter_config' command.
[hunter ** FATAL ERROR **]

please suggest sometthing to resolve this issue.

@mloskot
Copy link
Member

mloskot commented Nov 30, 2022

please suggest sometthing to resolve this issue.

@sv6375261073 Get in touch with Hunter community

p.s. Hijacking unrelated threads is a bad idea!

@t3sting3
Copy link

@rlei-weta did you ever get this to work or did you have to use a more current version? even with the fix that @grafikrobot shared, the error

fileunix.c:235:14: error: implicit declaration of function 'file_collect_archive_content_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if ( file_collect_archive_content_( archive ) < 0 )

still persists.

@t3sting3
Copy link

t3sting3 commented Oct 31, 2024

trying to fix an app for a client, but i absolutely have to get any boost 1.61 thru 1.65.1 compiled on clang 13 before i can move to a current version and having the same issue as you @rlei-weta and the commit that @grafikrobot linked is mostly unrelated to these issues.

using boost 1.65.1 (after using the commit posted above) :

###
### Using 'darwin' toolset.
###
rm -rf bootstrap
mkdir bootstrap
cc -o bootstrap/jam0 command.c compile.c constants.c debug.c execcmd.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c class.c cwd.c native.c md5.c w32_getreg.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c execunix.c fileunix.c pathunix.c
execcmd.c:120:5: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    out_printf( "...interrupted\n" );
    ^
1 error generated.
function.c:33:1: warning: '/*' within block comment [-Wcomment]
/* */
^
1 warning generated.
hash.c:29:1: warning: '/*' within block comment [-Wcomment]
/* */
^
1 warning generated.
jam.c:669:5: error: implicit declaration of function 'exec_done' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    exec_done();
    ^
jam.c:669:5: note: did you mean 'regex_done'?
jam.c:219:6: note: 'regex_done' declared here
void regex_done();
     ^
1 error generated.
make.c:105:5: error: implicit declaration of function 'exec_init' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    exec_init();
    ^
make.c:136:13: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            out_printf( "...found %d target%s...\n", counts->targets,
            ^
make.c:188:17: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                out_printf( "fate change  %s from %s to %s (as dependant of %s)\n",
                ^
make.c:219:17: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                out_printf( "fate change  %s from %s to %s (by rebuild)\n",
                ^
make.c:304:9: error: implicit declaration of function 'out_printf' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        out_printf( "make\t--\t%s%s\n", spaces( depth ), object_str( t->name ) );
        ^
make.c:304:41: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        out_printf( "make\t--\t%s%s\n", spaces( depth ), object_str( t->name ) );
                                        ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:304:41: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:311:41: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
        out_printf( "make\t--\t%s%s\n", spaces( depth ), object_str( t->name ) );
                                        ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:311:41: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:384:49: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            out_printf( "bind\t--\t%s%s: %s\n", spaces( depth ),
                                                ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:384:49: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:392:49: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            out_printf( "time\t--\t%s%s: %s\n", spaces( depth ),
                                                ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:392:49: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:397:49: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            out_printf( "time\t--\t%s%s: %s\n", spaces( depth ),
                                                ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:397:49: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
make.c:739:13: error: implicit declaration of function 'out_flush' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
            out_flush();
            ^
make.c:762:13: warning: adding 'int' to a string does not append to the string [-Wstring-plus-int]
            spaces( depth ), object_str( t->name ) );
            ^~~~~~~~~~~~~~~
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                    ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
make.c:762:13: note: use array indexing to silence this warning
make.c:85:44: note: expanded from macro 'spaces'
#define spaces(x) ( "                    " + ( x > 20 ? 0 : 20-x ) )
                                           ^
6 warnings and 6 errors generated.
strings.c:196:11: warning: expression result unused [-Wunused-value]
    for ( p; p >= self->value && ( *p == '\0' || isspace( *p ) ); *p-- = 0 );
          ^
1 warning generated.
filesys.c:360:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( archive->members ) )
         ^
filesys.c:496:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) )
         ^
filesys.c:534:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) )
         ^
filesys.c:570:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) ) return list;
         ^
filesys.c:593:11: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( !filelist_empty( list ) ) result = list->size;
          ^
filesys.c:602:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( list ) ) return;
         ^
6 errors generated.
modules/path.c:16:12: error: implicit declaration of function 'file_query' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    return file_query( list_front( lol_get( frame->args, 0 ) ) ) ?
           ^
1 error generated.
fileunix.c:236:10: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( filelist_empty( archive->members ) )
         ^
fileunix.c:238:14: error: implicit declaration of function 'file_collect_archive_content_' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
        if ( file_collect_archive_content_( archive ) < 0 )
             ^
fileunix.c:238:14: note: did you mean 'file_collect_dir_content_'?
fileunix.c:110:5: note: 'file_collect_dir_content_' declared here
int file_collect_dir_content_( file_info_t * const d )
    ^
fileunix.c:297:12: error: implicit declaration of function 'filelist_empty' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    if ( ! filelist_empty( archive->members ) ) filelist_free( archive->members );
           ^
3 errors generated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants