id summary reporter owner description type status milestone component version severity resolution keywords cc 10122 Recent Python versions trigger compiler error on AIX when compiling modules/regex.c: conflicting types for 'fgetpos64' Michael Haubenwallner Vladimir Prus "Since bugs.python.org/issue11184, recent Python releases (like Python-2.7.6) now have proper large-file support for AIX, defining _LARGE_FILES in , exposed to the user via . Now, bootstrapping boost.build for AIX using such a Python release causes the compiler errors shown in attached files when compiling modules/regex.c. The problem with modules/regex.c is: * `modules/regex.c` first includes `""../mem.h""` * `mem.h` includes `` includes `` Due to nothing relevant being defined yet, `` defines `_LARGE_FILE_API` * `stdlib.h` includes `` * `sys/types.h` does {`typedef long fpos_t;`}, because `_LARGE_FILES` is not defined If `_LARGE_FILES` were defined before, `sys/types.h` would have done {`typedef long long fpos_t;`} here. * `sys/types.h` does {`typedef long long fpos64_t;`} due to `_LARGE_FILE_API` being defined * `modules/regex.c` includes `""../native.h""` includes `""function.h""` includes `""frames.h""` includes `""lists.h""` includes `` includes [``, ``] * `pyconfig.h` defines `_LARGE_FILES` * `stdio.h` does not redefine the `fpos_t` things * `stdio.h` does {`#define fgetpos fgetpos64`} due to `_LARGE_FILES` being defined now * `stdio.h` declares {`extern int fgetpos(FILE*,fpos_t);`}, but remember `fgetpos` is defined to `fgetpos64` * `stdio.h` declares {`extern int fgetpos64(FILE*,fpos64_t);`} due to `_LARGE_FILE_API` being defined This problem is the same for the other functions the compilers yell about. Also, the same errors occur with current git master. For the fix: It is important to have all the ABI specific precompiler macros being defined before including any system header. Actually, the first thing `""jam.h""` does is to include ``. But with `modules/regex.c` first including `""../mem.h""` including ``, this rule is not followed. So the fix here is: {{{ --- a/src/engine/mem.h +++ b/src/engine/mem.h @@ -8,6 +8,8 @@ #ifndef BJAM_MEM_H #define BJAM_MEM_H +#include ""jam.h"" + #ifdef OPT_BOEHM_GC /* Use Boehm GC memory allocator. */ }}} While the fix for this very problem is quite simple, it doesn't look like if `` being included first everywhere else in build.git/src/engine is on purpose actually... Thank you!" Patches new To Be Determined build Boost 1.55.0 Problem