Debian testing, intel 64-bit, I get a similar message. Yesterday
(before the latest change) I compiled with Werror turned off, so it all
compiled, but it immediately produced a segmentation error when I tried
running it.
[.....]
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -Werror -I/usr/include
-I/usr/include/postgresql -rdynamic -g -O2 -MT apl-LvalCell.o -MD -MP
-MF .deps/apl-LvalCell.Tpo -c -o apl-LvalCell.o `test -f 'LvalCell.cc'
|| echo './'`LvalCell.cc
mv -f .deps/apl-LvalCell.Tpo .deps/apl-LvalCell.Po
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -Werror -I/usr/include
-I/usr/include/postgresql -rdynamic -g -O2 -MT apl-Malloc_hooks.o -MD
-MP -MF .deps/apl-Malloc_hooks.Tpo -c -o apl-Malloc_hooks.o `test -f
'Malloc_hooks.cc' || echo './'`Malloc_hooks.cc
mv -f .deps/apl-Malloc_hooks.Tpo .deps/apl-Malloc_hooks.Po
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -Werror -I/usr/include
-I/usr/include/postgresql -rdynamic -g -O2 -MT apl-Nabla.o -MD -MP -MF
.deps/apl-Nabla.Tpo -c -o apl-Nabla.o `test -f 'Nabla.cc' || echo
'./'`Nabla.cc
In file included from UTF8_string.hh:28,
from LibPaths.hh:24,
from Command.hh:27,
from Nabla.cc:23:
Simple_string.hh: In instantiation of ‘void Simple_string<T,
has_destructor>::insert_before(ShapeItem, const T&) [with T =
Nabla::FunLine; bool has_destructor = true; ShapeItem = long int]’:
Nabla.cc:861:47: required from here
Simple_string.hh:155:16: error: ‘void* memmove(void*, const void*,
size_t)’ writing to an object of type ‘struct Nabla::FunLine’ with no
trivial copy-assignment; use copy-assignment or copy-initialization
instead [-Werror=class-memaccess]
memmove(items + pos + 1, items + pos , (items_valid - pos) *
sizeof(T));
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from Nabla.cc:27:
Nabla.hh:104:11: note: ‘struct Nabla::FunLine’ declared here
struct FunLine
^~~~~~~
cc1plus: all warnings being treated as errors
make[3]: *** [Makefile:2730: apl-Nabla.o] Error 1
make[3]: Leaving directory '/home/wheagy/apl_svn/apl/trunk/src'
make[2]: *** [Makefile:3646: all-recursive] Error 1
make[2]: Leaving directory '/home/wheagy/apl_svn/apl/trunk/src'
make[1]: *** [Makefile:536: all-recursive] Error 1
make[1]: Leaving directory '/home/wheagy/apl_svn/apl/trunk'
make: *** [Makefile:424: all] Error 2
On 5/25/19 1:52 PM, Dr. Jürgen Sauermann wrote:
Hi Jerome,
I could not find anything wrong; the warning may or may not be bogus.
I nevertheless made a change to narrow down the problem and to make the
array subscript more explicit. Unfortunately the warnings below do not provide
sufficient information as to where exactly the problem was detected by the
compiler.
Please let me know if the warning occurs also in *SVN 1156*.
Thanks,
Jürgen
On 5/25/19 5:33 AM, Jerome Ibanes wrote:
Linux x86_64, Debian 8, g++ 4.9.2-10+deb8u1.
GNU APL Revision 1155.
[...]
g++ -DHAVE_CONFIG_H -I. -I.. -Wall -I sql -Werror -rdynamic -g
-O2 -MT apl-PrimitiveFunction.o -MD -MP -MF
.deps/apl-PrimitiveFunction.Tpo -c -o apl-PrimitiveFunction.o `test -f
'PrimitiveFunction.cc' || echo './'`PrimitiveFunction.cc
In file included from PrintBuffer.hh:28:0,
from Cell.hh:30,
from CharCell.hh:24,
from Value.hh:24,
from ArrayIterator.hh:25,
from PrimitiveFunction.cc:24:
Shape.hh: In static member function ‘static Value_P
Bif_COMMA::prepend_scalar(const Cell&, Axis, Value_P)’:
Shape.hh:109:41: error: array subscript is below array bounds
[-Werror=array-bounds]
{ Assert(r < rho_rho); return rho[r]; }
^
Shape.hh: In static member function ‘static Value_P
Bif_COMMA::append_scalar(Value_P, Axis, const Cell&)’:
Shape.hh:109:41: error: array subscript is below array bounds
[-Werror=array-bounds]
{ Assert(r < rho_rho); return rho[r]; }
^
Shape.hh: In static member function ‘static Token
Bif_COMMA::catenate(Value_P, Axis, Value_P)’:
Shape.hh:109:41: error: array subscript is below array bounds
[-Werror=array-bounds]
{ Assert(r < rho_rho); return rho[r]; }
^
Shape.hh:109:41: error: array subscript is below array bounds
[-Werror=array-bounds]
{ Assert(r < rho_rho); return rho[r]; }
^
cc1plus: all warnings being treated as errors
Makefile:2664: recipe for target 'apl-PrimitiveFunction.o' failed
Thank you.