I got that non-working version of apl-1.7.tar.gz from
ftp.gnu.org/pub/gnu/apl, dated 17 March 2017, so I guess it's a bit
out-of-date.
I just now got a chance to pull down the savannah svn version, which
./configures fine, but there a few compile errors with g++ (GCC) 8.1.1
20180502 (Red Hat 8.1.1-1). They're all the same nit-picking bug
complaining about memcpy:
error: ‘void* memcpy(void*, const void*, size_t)’ writing to an object
of type ‘class Token’ with no trivial copy-assignment; use
copy-initialization instead [-Werror=class-memaccess]
Here's the relevant portion of an svn diff:
Index: src/Executable.cc
===================================================================
--- src/Executable.cc (revision 1054)
+++ src/Executable.cc (working copy)
@@ -794,9 +794,9 @@
for (;t1 < t2; ++t1, --t2)
{
char tt[sizeof(Token)];
- memcpy(tt, t1, sizeof(Token));
- memcpy(t1, t2, sizeof(Token));
- memcpy(t2, tt, sizeof(Token));
+ memcpy(static_cast <void *>(tt), t1, sizeof(Token));
+ memcpy(static_cast <void *>(t1), t2, sizeof(Token));
+ memcpy(static_cast <void *>(t2), tt, sizeof(Token));
}
}
//-----------------------------------------------------------------------------
Index: src/InputFile.cc
===================================================================
--- src/InputFile.cc (revision 1054)
+++ src/InputFile.cc (working copy)
@@ -40,7 +40,7 @@
//-----------------------------------------------------------------------------
InputFile & InputFile::operator =(const InputFile & other)
{
- memcpy(this, &other, sizeof(InputFile)); // illegally duplicates
strings!
+ memcpy(static_cast <void *>(this), &other, sizeof(InputFile)); //
illegally duplicates strings!
::new (&object_filter) UCS_string_vector(other.object_filter);
new (&filename) UTF8_string(&other.filename[0], other.filename.size());
return *this;
Index: src/Token.cc
===================================================================
--- src/Token.cc (revision 1054)
+++ src/Token.cc (working copy)
@@ -840,9 +840,9 @@
for (;t1 < t2; ++t1, --t2)
{
char tt[sizeof(Token)];
- memcpy(tt, t1, sizeof(Token));
- memcpy(t1, t2, sizeof(Token));
- memcpy(t2, tt, sizeof(Token));
+ memcpy(static_cast <void *>(tt), t1, sizeof(Token));
+ memcpy(static_cast <void *>(t1), t2, sizeof(Token));
+ memcpy(static_cast <void *>(t2), tt, sizeof(Token));
}
}
(If you just do the obvious and (void *) cast the target argument, it
complains that you're using an "old style" cast.)
I don't have any older g++ versions around, so I have no idea if this
patch will break anything.
Chris
On 26/06/18 13:43, Juergen Sauermann wrote:
Hi Chris,
the *svn E155007* happens if you unpack a GNU APL tar file (as opposed to
checking out GNU APL from SVN, which is the proposed method). See
https://savannah.gnu.org/svn/?group=apl.
The other error was fixed already in *SVN* version *1052* (see
http://svn.savannah.gnu.org/viewvc/apl/trunk/src/Svar_record.hh?r1=1051&r2=1052
for details.
Fro the first error message I can see that you have SVN installed. So
checking out
the latest version of GNU APL is simply runnung this command:
*|svn co http://svn.savannah.gnu.org/svn/apl|*
That should give you the latest SVN version (currently *1053*) of GNU
APL where
both errors above should disappear.
File *apl-1.7.tar.gz* (whereever you found that) is too old to compile
under
the most recent *gcc* versions.
/// Jürgen