bugGNU Octave - Bugs: bug #59004, [octave forge] (communications)...

 
 

bug #59004: [octave forge] (communications) Error when trying to build (constness of cat op args)

Submitted by:  Markus Mützel <mmuetzel>
Submitted on:  Mon 24 Aug 2020 11:52:52 AM UTC  
 
Category:  Octave Forge Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Regression
Status:  Patch Submitted Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 22 Sep 2020 05:56:24 PM UTC, comment #4: 

Hello,

I found this bug report and would like to add to it instead of creating a new report. A related but different error happens on trying to install communications from Forge. This is on 64-bit Linux using the current dev version of Octave (hg id 903fe321649b).

octave:2> pkg install -forge communications
genqamdemod.cc:82:12: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
      if (!error_state)
           ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
op-gm-m.cc:132:3: error: cannot initialize a parameter of type 'octave::type_info::cat_op_fcn' (aka
      'octave_value (*)(const octave_base_value &, const octave_base_value &, const Array<long> &)') with an
      lvalue of type 'octave_value (octave_base_value &, const octave_base_value &, const Array<octave_idx_type>
      &)' (aka 'octave_value (octave_base_value &, const octave_base_value &, const Array<long> &)'): type
      mismatch at 1st parameter ('const octave_base_value &' vs 'octave_base_value &')
  INSTALL_CATOP_TI (ti, octave_galois, octave_matrix, gm_m);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:62:50: note: expanded from macro 'INSTALL_CATOP_TI'
  (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
                                                 ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:40:23: note: expanded from macro 'CONCAT2'
#define CONCAT2(x, y) CONCAT2X (x, y)
                      ^~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:39:24: note: expanded from macro 'CONCAT2X'
#define CONCAT2X(x, y) x ## y
                       ^~~~~~
<scratch space>:126:1: note: expanded from here
oct_catop_gm_m
^~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ov-typeinfo.h:121:53: note: passing argument to parameter 'f'
      here
    bool install_cat_op (int t1, int t2, cat_op_fcn f)
                                                    ^
op-gm-gm.cc:158:3: error: cannot initialize a parameter of type 'octave::type_info::cat_op_fcn' (aka
      'octave_value (*)(const octave_base_value &, const octave_base_value &, const Array<long> &)') with an
      lvalue of type 'octave_value (octave_base_value &, const octave_base_value &, const Array<octave_idx_type>
      &)' (aka 'octave_value (octave_base_value &, const octave_base_value &, const Array<long> &)'): type
      mismatch at 1st parameter ('const octave_base_value &' vs 'octave_base_value &')
  INSTALL_CATOP_TI (ti, octave_galois, octave_galois, gm_gm);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:62:50: note: expanded from macro 'INSTALL_CATOP_TI'
  (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
                                                 ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:40:23: note: expanded from macro 'CONCAT2'
#define CONCAT2(x, y) CONCAT2X (x, y)
                      ^~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:39:24: note: expanded from macro 'CONCAT2X'
#define CONCAT2X(x, y) x ## y
                       ^~~~~~
<scratch space>:147:1: note: expanded from here
oct_catop_gm_gm
^~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ov-typeinfo.h:121:53: note: passing argument to parameter 'f'
      here
    bool install_cat_op (int t1, int t2, cat_op_fcn f)
                                                    ^
op-gm-s.cc:71:3: error: dynamic_cast from 'const octave_base_value' to 'octave_galois &' casts away qualifiers
  CAST_BINOP_ARGS (octave_galois&, const octave_scalar&);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./galois-ops.h:26:11: note: expanded from macro 'CAST_BINOP_ARGS'
  t1 v1 = dynamic_cast<t1> (a1);                \
          ^~~~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Makefile:44: op-gm-gm.o] Error 1
make: *** Waiting for unfinished jobs....
1 error generated.
make: *** [Makefile:44: op-gm-m.o] Error 1
1 error generated.
make: *** [Makefile:44: op-gm-s.o] Error 1
1 warning generated.
gf.cc:183:13: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
      if (! error_state)
            ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:430:3: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  DATA_REDUCTION (prod);
  ^
gf.cc:393:13: note: expanded from macro 'DATA_REDUCTION'
      if (! error_state) \
            ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:430:3: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  DATA_REDUCTION (prod);
  ^
gf.cc:402:25: note: expanded from macro 'DATA_REDUCTION'
                  if (! error_state) \
                        ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:449:3: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  DATA_REDUCTION (sum);
  ^
gf.cc:393:13: note: expanded from macro 'DATA_REDUCTION'
      if (! error_state) \
            ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:449:3: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  DATA_REDUCTION (sum);
  ^
gf.cc:402:25: note: expanded from macro 'DATA_REDUCTION'
                  if (! error_state) \
                        ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:474:3: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  DATA_REDUCTION (sumsq);
  ^
gf.cc:393:13: note: expanded from macro 'DATA_REDUCTION'
      if (! error_state) \
            ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:474:3: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  DATA_REDUCTION (sumsq);
  ^
gf.cc:402:25: note: expanded from macro 'DATA_REDUCTION'
                  if (! error_state) \
                        ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:1020:9: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  if (! error_state)
        ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
gf.cc:1107:9: warning: 'error_state' is deprecated [-Wdeprecated-declarations]
  if (! error_state)
        ^
/usr/local/include/octave-7.0.0/octave/error.h:494:1: note: 'error_state' has been explicitly marked deprecated
      here
OCTAVE_DEPRECATED (6, "this variable is obsolete and always has the value 0")
^
/usr/local/include/octave-7.0.0/octave/octave-config.h:77:59: note: expanded from macro 'OCTAVE_DEPRECATED'
#      define OCTAVE_DEPRECATED(ver, msg) __attribute__ ((__deprecated__))
                                                          ^
op-m-gm.cc:133:3: error: cannot initialize a parameter of type 'octave::type_info::cat_op_fcn' (aka
      'octave_value (*)(const octave_base_value &, const octave_base_value &, const Array<long> &)') with an
      lvalue of type 'octave_value (octave_base_value &, const octave_base_value &, const Array<octave_idx_type>
      &)' (aka 'octave_value (octave_base_value &, const octave_base_value &, const Array<long> &)'): type
      mismatch at 1st parameter ('const octave_base_value &' vs 'octave_base_value &')
  INSTALL_CATOP_TI (ti, octave_matrix, octave_galois, m_gm);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:62:50: note: expanded from macro 'INSTALL_CATOP_TI'
  (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
                                                 ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:40:23: note: expanded from macro 'CONCAT2'
#define CONCAT2(x, y) CONCAT2X (x, y)
                      ^~~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ops.h:39:24: note: expanded from macro 'CONCAT2X'
#define CONCAT2X(x, y) x ## y
                       ^~~~~~
<scratch space>:127:1: note: expanded from here
oct_catop_m_gm
^~~~~~~~~~~~~~
/usr/local/include/octave-7.0.0/octave/../octave/ov-typeinfo.h:121:53: note: passing argument to parameter 'f'
      here
    bool install_cat_op (int t1, int t2, cat_op_fcn f)
                                                    ^
1 error generated.
make: *** [Makefile:44: op-m-gm.o] Error 1
9 warnings generated.
make: Entering directory '/tmp/oct-5aeT2d/communications-1.2.2/src'
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H __errcore__.cc -o __errcore__.oct
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H __gfweight__.cc -o __gfweight__.oct
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H cyclgen.cc -o cyclgen.oct
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H cyclpoly.cc -o cyclpoly.oct
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H genqamdemod.cc -o genqamdemod.oct
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c galois-def.cc -o galois-def.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c galois.cc -o galois.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c galoisfield.cc -o galoisfield.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c gf.cc -o gf.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c op-gm-gm.cc -o op-gm-gm.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c op-gm-m.cc -o op-gm-m.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c op-gm-s.cc -o op-gm-s.o
/usr/local/bin/mkoctfile-7.0.0 -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H -c op-m-gm.cc -o op-m-gm.o
make: Leaving directory '/tmp/oct-5aeT2d/communications-1.2.2/src'

error: pkg: error running 'make' for the communications package.
error: called from
    configure_make at line 110 column 9
    install at line 196 column 7
    pkg at line 568 column 9
octave:3>

Anonymous
Wed 26 Aug 2020 10:52:24 AM UTC, comment #3: 

Thank you for looking into this.

All buildbot builders seem to be happy with your patch.

I'll leave this report open and make it about the communications package if nobody minds.

Link to the patch:
https://hg.octave.org/mxe-octave/file/d46a116f2c8d/src/of-communications-1-catop.patch

Markus Mützel <mmuetzel>
Project Member
Tue 25 Aug 2020 07:10:49 PM UTC, comment #2: 

I worked on this a little more today but still did not see a good way to fix Octave so that it could use catop functions with either const or non-const first arguments.  So I checked in the following patch file for the communications package in mxe-octave.  Maybe that change (or something similar) could be used in the next release of the communications package.

https://hg.octave.org/mxe-octave/rev/d46a116f2c8d

John W. Eaton <jwe>
Project Administrator
Mon 24 Aug 2020 07:22:20 PM UTC, comment #1: 

I don't see an easy way to make the internal table of concatenation op functions have the proper const prototype and still allow the old-style definition with a non-const first argument.

John W. Eaton <jwe>
Project Administrator
Mon 24 Aug 2020 11:52:52 AM UTC, original submission:  

Building the communication package with a current default branch stops with this error:

x86_64-w64-mingw32-g++ -c -I/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include  -I/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/.. -I/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave -I/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include   -fopenmp -g -O2    -DGALOIS_DISP_PRIVATES -DHAVE_CONFIG_H op-gm-gm.cc -o op-gm-gm.o
In file included from op-gm-gm.cc:30:
op-gm-gm.cc: In function 'void install_gm_gm_ops(octave::type_info&)':
/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/ops.h:62:59: error: invalid conversion from 'octave_value (*)(octave_base_value&, const octave_base_value&, const Array<long long int>&)' to 'octave::type_info::cat_op_fcn' {aka 'octave_value (*)(const octave_base_value&, const octave_base_value&, const Array<long long int>&)'} [-fpermissive]
   62 |   (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
      |                                                           ^~~~~~~~~~
      |                                                           |
      |                                                           octave_value (*)(octave_base_value&, const octave_base_value&, const Array<long long int>&)
/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/ops.h:39:24: note: in definition of macro 'CONCAT2X'
   39 | #define CONCAT2X(x, y) x ## y
      |                        ^
/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/ops.h:62:50: note: in expansion of macro 'CONCAT2'
   62 |   (t1::static_type_id (), t2::static_type_id (), CONCAT2 (oct_catop_, f));
      |                                                  ^~~~~~~
op-gm-gm.cc:158:3: note: in expansion of macro 'INSTALL_CATOP_TI'
  158 |   INSTALL_CATOP_TI (ti, octave_galois, octave_galois, gm_gm);
      |   ^~~~~~~~~~~~~~~~
In file included from /home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/ov-fcn.h:38,
                 from /home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/ov-builtin.h:35,
                 from /home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/defun-int.h:33,
                 from /home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/defun-dld.h:35,
                 from /home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/oct.h:35,
                 from op-gm-gm.cc:24:
/home/osboxes/Repositories/Octave/mxe-octave-1/usr/x86_64-w64-mingw32/include/octave-7.0.0/octave/../octave/ov-typeinfo.h:121:53: note:   initializing argument 3 of 'bool octave::type_info::install_cat_op(int, int, octave::type_info::cat_op_fcn)'
  121 |     bool install_cat_op (int t1, int t2, cat_op_fcn f)
      |                                          ~~~~~~~~~~~^
make[2]: *** [Makefile:44: op-gm-gm.o] Error 1

This is probably related to this changeset:
https://hg.savannah.gnu.org/hgweb/octave/rev/35f974bab4c8

fix constness of cat op args

Declare the first argument of the cat_op concatenation operators const.

* ov-typeinfo.h (cat_op_fcn): Make first argument of concatenation
operator typedef const.

* op-b-sbm.cc, op-bm-sbm.cc, op-chm.cc, op-cm-scm.cc, op-cm-sm.cc,
op-cs-scm.cc, op-cs-sm.cc, op-m-scm.cc, op-m-sm.cc, op-s-scm.cc,
op-s-sm.cc, op-sbm-b.cc, op-sbm-bm.cc, op-scm-cm.cc, op-scm-cs.cc,
op-scm-m.cc, op-scm-s.cc, op-sm-cm.cc, op-sm-cs.cc, op-sm-m.cc,
op-sm-s.cc, op-struct.cc: Fix concatentation operator declarations and
casts as needed.
* ops.h (DEFCATOPX, DEFCATOP, DEFCATOP_FN, DEFNDCATOP_FN,
DEFNDCHARCATOP_FN, DEFNDCATOP_FN2): Likewise.
author        John W. Eaton <jwe@octave.org>
date        Thu, 30 Jul 2020 16:15:03 -0400 (3 weeks ago)

Should the old function prototype be restored and properly deprecated?

Markus Mützel <mmuetzel>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Posted a comment)
  • -email is unavailable- added by mmuetzel (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

     

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-08-26 mmuetzel CategoryInterpreter => Octave Forge Package
        StatusNone => Patch Submitted
        SummaryError when trying to build of-communications (constness of cat op args) => [octave forge] (communications) Error when trying to build (constness of cat op args)

    Back to the top


    Powered by Savane 3.5