Opened 12 years ago

Closed 10 years ago

#5048 closed Bugs (fixed)

compilation error under ia64 HP-UX11i with gcc-4.4.0

Reported by: ruipfernandes@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.52.0 Severity: Problem
Keywords: HP-UX Cc:

Description

The error is:

« In file included from libs/filesystem/v3/src/utf8_codecvt_facet.cpp:19: ./libs/detail/utf8_codecvt_facet.cpp:255:7: error: missing binary operator before token "("

"g++" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -pthread -fPIC -mlp64 -DBOOST_ALL_NO_LIB=1 -DBOOST_FILESYSTEM_DYN_LINK=1 -DBOOST_SYSTEM_DYN_LINK=1 -I"." -c -o "bin.v2/libs/filesystem/build/gcc-4.4.0/debug/threading-multi/v3/src/utf8_codecvt_facet.o" "libs/filesystem/v3/src/utf8_codecvt_facet.cpp"

...failed gcc.compile.c++ bin.v2/libs/filesystem/build/gcc-4.4.0/debug/threading-multi/v3/src/utf8_codecvt_facet.o... »

I solved the problem with the attached patch

Attachments (1)

boost_1_45_filesystem_gcc_hpux_patch (730 bytes ) - added by ruipfernandes@… 12 years ago.
patch

Download all attachments as: .zip

Change History (9)

by ruipfernandes@…, 12 years ago

patch

comment:1 by Beman Dawes, 12 years ago

Fixing the problem by defining _INCLUDE_STDCSOURCE_199901 in the jamfile solves the problem for those who use Boost.Build, but doesn't solve it for those who build via some other build system.

The preferred fix would be to add a #define _INCLUDE_STDCSOURCE_199901 somewhere, perhaps <boost/config/platform/hpux.hpp>.

Is that a workable solution? What does _INCLUDE_STDCSOURCE_199901 actually do?

--Beman

comment:2 by ruipfernandes@…, 12 years ago

Indeed, changing the jam file isn't the best way.

Answering your questions: a) yes, defining in <boost/config/platform/hpux.hpp> works fine; b) the reason why the definition is required is referred in file wchar.h, as follows:

/* C99 stds require WCHAR_MAX and WCHAR_MIN to be macros which

can be used in #if constructs, hence, can't have casts Retaining the old macros for compatibility

*/

# if defined(_INCLUDE_STDCSOURCE_199901) # define WCHAR_MAX UINT_MAX /* max value of an unsigned integer */ # define WCHAR_MIN 0 # else # define WCHAR_MAX (wchar_t)UINT_MAX /* max value of an unsigned integer */ # define WCHAR_MIN (wchar_t)0 # endif

comment:3 by Beman Dawes, 11 years ago

Resolution: fixed
Status: newclosed

(In [72521]) Fix #5048, for HP-UX

in reply to:  3 ; comment:4 by ruipfernandes@…, 10 years ago

Replying to bemandawes:

(In [72521]) Fix #5048, for HP-UX

I'm updating from 1.45 to 1.52 now and I can tell this does not solve the problem. For some reason the define is required before getting to include this header. To compile successfully I had to define _INCLUDE_STDCSOURCE_199901 globally.

comment:5 by ruipfernandes@…, 10 years ago

Resolution: fixed
Status: closedreopened
Version: Boost 1.45.0Boost 1.52.0

in reply to:  4 ; comment:6 by anonymous, 10 years ago

Replying to ruipfernandes@…:

Replying to bemandawes:

(In [72521]) Fix #5048, for HP-UX

I'm updating from 1.45 to 1.52 now and I can tell this does not solve the problem. For some reason the define is required before getting to include this header. To compile successfully I had to define _INCLUDE_STDCSOURCE_199901 globally.

I found what the problem is: the define is misspelled. Please fix to: _INCLUDE_STDCSOURCE_199901

in reply to:  6 comment:7 by anonymous, 10 years ago

Replying to anonymous:

Replying to ruipfernandes@…:

Replying to bemandawes:

(In [72521]) Fix #5048, for HP-UX

I'm updating from 1.45 to 1.52 now and I can tell this does not solve the problem. For some reason the define is required before getting to include this header. To compile successfully I had to define _INCLUDE_STDCSOURCE_199901 globally.

I found what the problem is: the define is misspelled. Please fix to:

_INCLUDE_STDC__SOURCE_199901

comment:8 by Beman Dawes, 10 years ago

Resolution: fixed
Status: reopenedclosed

(In [83443]) For HP-UX/GCC only, define _INCLUDE_STDCSOURCE_199901 as a build requirement. Fix #5048.

Note: See TracTickets for help on using tickets.