bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Error building libapl


From: Dr . Jürgen Sauermann
Subject: Re: [Bug-apl] Error building libapl
Date: Mon, 3 Jun 2019 11:27:49 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:60.0) Gecko/20100101 Thunderbird/60.6.1

Hi Rowan,

I am currently in the process of changing a few things related to class Simple_string.
This class was needed in the early days of GNU APL since at that time (around 2008)
the standard C++ libraries that I used did not behave as I thought they should.

These days the libraries work fine and the
Simple_string class should now be replaced
with std::string<> and std::vector<>.

The warnings that you see are caused by the fact that sizes (= string lengths) are signed
in
Simple_string but unsigned in the standard C++ libraries. The g++ 4.8 did not issue
these warnings, but g++ 5.4 does.

All these warnings are kind of bogus and force me to cast between signed and unsigned
in very many places (GNU APL has now more than 100,000 lines of code).
In order to get your libapl you have a number of options:

A.  svn co an older version of GNU APL. Any version from April 2019 should do, or
B.  remove the -Werror from the CXX_FLAGS, or
C.  If there are not too many warnings: cast one side of the failed comparisons to what
     the compiler wants to see, or
D.  wait a little (hopefully less than 2 weeks) until this transition is over.

I am not building libapl frequently, so some errors may have slipped in over time.
What you could do to help is to find the exact SVN version number where the error occurred first
and send me the diffs (command svn diff -rXXX:YYY) to the version before.

Thanks,
Jürgen Sauermann



On 6/3/19 12:20 AM, Rowan Cannaday wrote:
Thank you so much!

Your change fixed that specific error.
I am still getting additional errors.
Including the messages below.

Let me know if there's anything I can do to help!

- Rowan

```
/bin/bash ../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..    -Wall -I sql -Werror     -rdynamic -g -O2 -MT libapl_la-libapl.lo -MD -MP -MF .deps/libapl_la-libapl.Tpo -c -o libapl_la-libapl.lo `test -f 'libapl.cc' || echo './'`libapl.cc
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -Werror -rdynamic -g -O2 -MT libapl_la-libapl.lo -MD -MP -MF .deps/libapl_la-libapl.Tpo -c libapl.cc  -fPIC -DPIC -o .libs/libapl_la-libapl.o
libapl.cc: In function ‘int64_t get_axis(APL_value, unsigned int)’:
libapl.cc:143:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘uRank’ {aka ‘unsigned int’} [-Werror=sign-compare]
    return int(axis) < val->get_rank() ? val->get_shape_item(axis) : -1;
           ~~~~~~~~~~^~~~~~~~~~~~~~~~~
libapl.cc: In function ‘void set_value(APL_value, APL_value, uint64_t)’:
libapl.cc:329:40: error: no matching function for call to ‘Value::decrement_owner_count(Value*&, const char [14])’
         v->decrement_owner_count(v, LOC);
                                        ^
In file included from ./Command.hh:28,
                 from ./Workspace.hh:26,
                 from libapl.cc:25:
./Value.hh:558:12: note: candidate: ‘void Value::decrement_owner_count(const char*)’
       void decrement_owner_count(const char * loc)
            ^~~~~~~~~~~~~~~~~~~~~
./Value.hh:558:12: note:   candidate expects 1 argument, 2 provided
libapl.cc:340:75: error: no matching function for call to ‘PointerCell::PointerCell(Value_P, Value&)’
         new (cell)   PointerCell(src.get_pointer_value()->clone(LOC), *val);
                                                                           ^
In file included from ./Value.hh:29,
                 from ./Command.hh:28,
                 from ./Workspace.hh:26,
                 from libapl.cc:25:
./PointerCell.hh:41:4: note: candidate: ‘PointerCell::PointerCell(Value*, Value&, uint32_t)’
    PointerCell(Value * val, Value & cell_owneri, uint32_t magic);
    ^~~~~~~~~~~
./PointerCell.hh:41:4: note:   candidate expects 3 arguments, 2 provided
./PointerCell.hh:37:4: note: candidate: ‘PointerCell::PointerCell(Value*, Value&)’
    PointerCell(Value * val, Value & cell_owner);
    ^~~~~~~~~~~
./PointerCell.hh:37:4: note:   no known conversion for argument 1 from ‘Value_P’ to ‘Value*’
./PointerCell.hh:33:7: note: candidate: ‘constexpr PointerCell::PointerCell(const PointerCell&)’
 class PointerCell : public Cell
       ^~~~~~~~~~~
./PointerCell.hh:33:7: note:   candidate expects 1 argument, 2 provided
./PointerCell.hh:33:7: note: candidate: ‘constexpr PointerCell::PointerCell(PointerCell&&)’
./PointerCell.hh:33:7: note:   candidate expects 1 argument, 2 provided
libapl.cc:344:61: error: no matching function for call to ‘PointerCell::PointerCell(Value_P, Value&)’
         new (cell)   PointerCell(new_value->clone(LOC), *val);
                                                             ^
In file included from ./Value.hh:29,
                 from ./Command.hh:28,
                 from ./Workspace.hh:26,
                 from libapl.cc:25:
./PointerCell.hh:41:4: note: candidate: ‘PointerCell::PointerCell(Value*, Value&, uint32_t)’
    PointerCell(Value * val, Value & cell_owneri, uint32_t magic);
    ^~~~~~~~~~~
./PointerCell.hh:41:4: note:   candidate expects 3 arguments, 2 provided
./PointerCell.hh:37:4: note: candidate: ‘PointerCell::PointerCell(Value*, Value&)’
    PointerCell(Value * val, Value & cell_owner);
    ^~~~~~~~~~~
./PointerCell.hh:37:4: note:   no known conversion for argument 1 from ‘Value_P’ to ‘Value*’
./PointerCell.hh:33:7: note: candidate: ‘constexpr PointerCell::PointerCell(const PointerCell&)’
 class PointerCell : public Cell
       ^~~~~~~~~~~
./PointerCell.hh:33:7: note:   candidate expects 1 argument, 2 provided
./PointerCell.hh:33:7: note: candidate: ‘constexpr PointerCell::PointerCell(PointerCell&&)’
./PointerCell.hh:33:7: note:   candidate expects 1 argument, 2 provided
libapl.cc: In function ‘int apl_exec(const char*)’:
libapl.cc:362:35: error: no matching function for call to ‘StateIndicator::get_error() const’
    if (si)   return si->get_error().error_code;
                                   ^
In file included from ./PrimitiveOperator.hh:25,
                 from ./Workspace.hh:27,
                 from libapl.cc:25:
./StateIndicator.hh:127:19: note: candidate: ‘static Error& StateIndicator::get_error(StateIndicator*)’
    static Error & get_error(StateIndicator * si)
                   ^~~~~~~~~
./StateIndicator.hh:127:19: note:   candidate expects 1 argument, 0 provided
./StateIndicator.hh:131:25: note: candidate: ‘static const Error& StateIndicator::get_error(const StateIndicator*)’
    static const Error & get_error(const StateIndicator * si)
                         ^~~~~~~~~
./StateIndicator.hh:131:25: note:   candidate expects 1 argument, 0 provided
libapl.cc: In function ‘int apl_exec_ucs(const unsigned int*)’:
libapl.cc:378:35: error: no matching function for call to ‘StateIndicator::get_error() const’
    if (si)   return si->get_error().error_code;
                                   ^
In file included from ./PrimitiveOperator.hh:25,
                 from ./Workspace.hh:27,
                 from libapl.cc:25:
./StateIndicator.hh:127:19: note: candidate: ‘static Error& StateIndicator::get_error(StateIndicator*)’
    static Error & get_error(StateIndicator * si)
                   ^~~~~~~~~
./StateIndicator.hh:127:19: note:   candidate expects 1 argument, 0 provided
./StateIndicator.hh:131:25: note: candidate: ‘static const Error& StateIndicator::get_error(const StateIndicator*)’
    static const Error & get_error(const StateIndicator * si)
                         ^~~~~~~~~
./StateIndicator.hh:131:25: note:   candidate expects 1 argument, 0 provided
libapl.cc: In function ‘void Unicode_to_UTF8(int, char*, int*)’:
libapl.cc:604:21: error: no matching function for call to ‘UTF8_string::UTF8_string(UCS_string (&)(Unicode))’
 UTF8_string utf8(ucs);
                     ^
In file included from ./LibPaths.hh:24,
                 from ./Command.hh:27,
                 from ./Workspace.hh:26,
                 from libapl.cc:25:
./UTF8_string.hh:72:4: note: candidate: ‘UTF8_string::UTF8_string(const Value&)’
    UTF8_string(const Value & value);
    ^~~~~~~~~~~
./UTF8_string.hh:72:4: note:   no known conversion for argument 1 from ‘UCS_string(Unicode)’ to ‘const Value&’
./UTF8_string.hh:68:4: note: candidate: ‘UTF8_string::UTF8_string(const UCS_string&)’
    UTF8_string(const UCS_string & ucs);
    ^~~~~~~~~~~
./UTF8_string.hh:68:4: note:   no known conversion for argument 1 from ‘UCS_string(Unicode)’ to ‘const UCS_string&’
./UTF8_string.hh:60:4: note: candidate: ‘UTF8_string::UTF8_string(const UTF8*, size_t)’
    UTF8_string(const UTF8 * str, size_t len)
    ^~~~~~~~~~~
./UTF8_string.hh:60:4: note:   candidate expects 2 arguments, 1 provided
./UTF8_string.hh:56:4: note: candidate: ‘UTF8_string::UTF8_string(const char*)’
    UTF8_string(const char * str)
    ^~~~~~~~~~~
./UTF8_string.hh:56:4: note:   no known conversion for argument 1 from ‘UCS_string(Unicode)’ to ‘const char*’
./UTF8_string.hh:52:4: note: candidate: ‘UTF8_string::UTF8_string()’
    UTF8_string()
    ^~~~~~~~~~~
./UTF8_string.hh:52:4: note:   candidate expects 0 arguments, 1 provided
./UTF8_string.hh:48:7: note: candidate: ‘UTF8_string::UTF8_string(const UTF8_string&)’
 class UTF8_string : public std::basic_string<UTF8>
       ^~~~~~~~~~~
./UTF8_string.hh:48:7: note:   no known conversion for argument 1 from ‘UCS_string(Unicode)’ to ‘const UTF8_string&’
./UTF8_string.hh:48:7: note: candidate: ‘UTF8_string::UTF8_string(UTF8_string&&)’
./UTF8_string.hh:48:7: note:   no known conversion for argument 1 from ‘UCS_string(Unicode)’ to ‘UTF8_string&&’
libapl.cc:605:22: error: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<unsigned char>::size_type’ {aka ‘long unsigned int’} [-Werror=sign-compare]
    for (int d = 0; d < utf8.size(); ++d)   dest[d] = utf8[d];
                    ~~^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2119: libapl_la-libapl.lo] Error 1
```

On Sun, Jun 2, 2019 at 8:50 PM Dr. Jürgen Sauermann <address@hidden> wrote:
Hi Rowan,

thanks for reporting this. Supposedly fixed in SVN 1162.

Best Regards,
/// Jürgen


On 6/2/19 10:17 PM, Rowan Cannaday wrote:
Hello!

I am trying to compile libapl, and am running into the following error:

```
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -Wold-style-cast -Werror -I/usr/include -I/usr/include/postgresql -rdynamic -g -O2 -MT libapl_la-libapl.lo -MD -MP -MF .deps/libapl_la-libapl.Tpo -c libapl.cc  -fPIC -DPIC -o .libs/libapl_la-libapl.o
libapl.cc: In function 'Value* get_value(APL_value, uint64_t)':
libapl.cc:210:4: error: 'Z' was not declared in this scope
    Z.get()->increment_owner_count(LOC);   // keep value
```

I am using the following to configure:
```
./configure --with-libapl
```
 
I have built the interpreter successfully before.

I also generated a tags file for the project and it is unable to find the definition for 'Z'.

Any help is appreciated, thank you for your time!



reply via email to

[Prev in Thread] Current Thread [Next in Thread]