Hi Subhraman,

thanks for reporting this.

Two separate problems in libapl.cc:

1. release_value() had an invalid const_cast between Value and cValue
   (two distinct classes, not the same type differently cv-qualified).
   Since APL_value is Value*, "const APL_value val" means "Value* const"
   (a const pointer to a non-const Value), not "pointer to const Value" —
   val was never actually const, so the cast was wrong and unnecessary.

2. Once that compiles, libapl.cc hits ten more errors: several eval_*
   calls still passed a raw Value* where the eval_AB/eval_ALB/eval_AXB/…
   signatures now expect "const cValue &" (the cValue_R refactor from
*SVN r2025*). Fixed by dereferencing (*A instead of A.get()), matching
   the idiom used elsewhere in the interpreter.

Also cleaned up the Function_PC/size_t signedness warning you quoted,
since this tree builds with -Werror.

Both apl and libapl.so now build cleanly here, including with -Werror.
Fixed in *SVN r2037*.

Best regards,
Jürgen

P.S. This reply was drafted with the help of Claude Code
     (https://savannah.gnu.org/projects/apl).



On 7/12/26 06:47, Subhraman Sarkar wrote:
Hello,
Building apl succeeds, but cannot build libapl with the following error:

    libapl.cc: In function ‘void release_value(APL_value, const char*)’:
    libapl.cc:131:34: error: invalid ‘const_cast’ from type ‘const
    APL_value’ {aka ‘Value* const’} to type ‘cValue*’
      131 | Value * v = static_cast<Value *>(const_cast<cValue *>(val));
          |  ^~~~~~~~~~~~~~~~~~~~~~~~~
    libapl.cc: In function ‘const Function* get_function_ucs(const
    unsigned int*, const Function**, const Function**)’:
    libapl.cc:574:44: warning: comparison of integer expressions of
    different signedness: ‘Function_PC’ and
    ‘std::vector<Token>::size_type’ {aka ‘long unsigned int’}
    [-Wsign-compare]
      574 |    for (Function_PC PC = Function_PC_0; PC < tos.size(); ++PC)
          | ~~~^~~~~~~~~~~~


There are a lot more of those, on libapl.cc.

Build details:
Commit: 8b3cc77207021c472991ca476f61544da4bf96c8 (git, latest master)
OS: Devuan Excalibur
GCC: 14.2.0
Autoconf: autoconf (GNU Autoconf) 2.72

If any more details are needed, please ask.
  • Build failure ... Subhraman Sarkar
    • Re: Build... Dr . Jürgen Sauermann via Bugs and suggestions for GNU APL

Reply via email to