bsc-pm / mcxx

Mercurium is a C/C++/Fortran source-to-source compilation infrastructure aimed at fast prototyping developed by the Programming Models group at the Barcelona Supercomputing Center
GNU Lesser General Public License v3.0
70 stars 23 forks source link

`error: ‘ICONV_CONST’ undeclared`, maybe a bug in the code? #35

Open vineetsoni opened 4 years ago

vineetsoni commented 4 years ago

I'm getting the following build error after the configuration:

  CC       src/frontend/src_frontend_libmcxx_la-cxx-dyninit.lo
  CC       src/frontend/src_frontend_libmcxx_la-cxx-tltype.lo
  CC       src/frontend/src_frontend_libmcxx_la-cxx-exprtype.lo
../src/frontend/cxx-exprtype.c: In function ‘string_literal_type’:
../src/frontend/cxx-exprtype.c:2449:13: error: ‘ICONV_CONST’ undeclared (first use in this function); did you mean ‘CV_CONST’?
             ICONV_CONST char* inbuff = (ICONV_CONST char*)codepoints;
             ^~~~~~~~~~~
             CV_CONST
../src/frontend/cxx-exprtype.c:2449:13: note: each undeclared identifier is reported only once for each function it appears in
../src/frontend/cxx-exprtype.c:2449:25: error: expected ‘;’ before ‘char’
             ICONV_CONST char* inbuff = (ICONV_CONST char*)codepoints;
                         ^~~~
../src/frontend/cxx-exprtype.c:2455:45: error: ‘inbuff’ undeclared (first use in this function); did you mean ‘outbuff’?
             size_t conv_result = iconv(cd, &inbuff, &inbyteslefts, &outbuff, &outbytesleft);
                                             ^~~~~~
                                             outbuff
Makefile:8167: recipe for target 'src/frontend/src_frontend_libmcxx_la-cxx-exprtype.lo' failed
make[2]: *** [src/frontend/src_frontend_libmcxx_la-cxx-exprtype.lo] Error 1

This is what I get whether I use --with-libiconv-prefix=<path> or --without-libiconv-prefix flag in the configuration.

Maybe it looks like a bug in the src?

rofirrim commented 4 years ago

This is a macro that is defined during configure.

In principle GNU libc has its own iconv implementation so there is no need to specify --with-libiconv-prefix.