bug-apl
[Top][All Lists]
Advanced

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

Re: [Bug-apl] Possible bug in APL


From: Juergen Sauermann
Subject: Re: [Bug-apl] Possible bug in APL
Date: Tue, 3 Jul 2018 20:23:58 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.3.0

Hi Chris,

thanks, fixed in SVN 1055.

/// Jürgen


On 07/02/2018 09:21 PM, Chris Moller wrote:

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





Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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