Ravenbrook / mps

The Memory Pool System
http://www.ravenbrook.com/project/mps
Other
557 stars 75 forks source link

macOS build fails with Xcode 15.2 #279

Open gerd-moellmann opened 6 months ago

gerd-moellmann commented 6 months ago

Building using xcodebuild fails for me because the variable added in TransformAddOldNew() is unused (it really is), and -Werror,... is set. The following makes mps build successfully:

modified   code/trans.c
@@ -151,7 +151,6 @@ Res TransformAddOldNew(Transform transform,
 {
   Res res;
   Index i;
-  Count added = 0;
   Arena arena;

   AVERT(Transform, transform);
@@ -190,8 +189,6 @@ Res TransformAddOldNew(Transform transform,
     AVER(res != ResFAIL); /* It's a static error to add the same old twice. */
     if (res != ResOK)
       return res;
-    
-    ++added;
   }

   AVERT(Transform, transform);
thejayps commented 6 months ago

Thanks for bringing this to our attention - it seems "added" is not used in the code but we'll double check that removing it is the correct fix

gerd-moellmann commented 6 months ago

thejayps @.***> writes:

Thanks for bringing this to our attention - it seems "added" is not used in the code but we'll double check that removing it is the correct fix

Thanks!

skangas commented 1 month ago
modified   code/trans.c
@@ -151,7 +151,6 @@ Res TransformAddOldNew(Transform transform,
 {
   Res res;
   Index i;
-  Count added = 0;
   Arena arena;

   AVERT(Transform, transform);
@@ -190,8 +189,6 @@ Res TransformAddOldNew(Transform transform,
     AVER(res != ResFAIL); /* It's a static error to add the same old twice. */
     if (res != ResOK)
       return res;
-    
-    ++added;
   }

   AVERT(Transform, transform);

For what it's worth, the above fix works here. Built on macOS 14.5 with Xcode 15.4.