Skip to content

refactor: remove dead code and scope deprecation suppression - #11

Merged
softmaxe merged 2 commits into
mainfrom
refactor/remove-dead-code
Oct 30, 2026
Merged

softmaxe merged 2 commits into
mainfrom
refactor/remove-dead-code

Conversation

@softmaxe

Copy link
Copy Markdown
Owner

Summary

Dead-code audit result: no unused functions, macros, extern declarations, or files. Two small leftovers are removed, and the deprecation suppression is narrowed so it stops hiding new deprecations.

 ferry.m
-#include <unistd.h>
 parse_positive
-  return (end && *end == '\0' && ...
+  return (*end == '\0' && ...
+process_pid                  // sole GetProcessPID caller, pragma scoped here
 main
-  #pragma ... ignored "-Wdeprecated-declarations"   // covered all of main
-  GetProcessPID(&front, &pid)
+  pid = process_pid(&front)

 tests/follow.m
-  pragma covered restore_app and main
+  pragma covers restore_app only

This matches upstream yabai, which also scopes this suppression to individual functions.

Evidence

  • Before: the -Wdeprecated-declarations pragma covers the whole of main for two GetProcessPID calls, so -Werror cannot catch a new deprecation there.
    After: with the build flags CI uses, CFLAGS="-O2 -Werror" make all test build/follow-test passes: 10 CLI checks and 3 binary checks, and the live test compiles.
  • clang -Wunused -Wunused-macros -Wunreachable-code-aggressive reports nothing on src/ferry.m or tests/follow.m.
  • make test-follow was not run: it switches Spaces on a live desktop.

Merge Danger

Door: two-way

Blast Radius: small

The PID lookup is now behind process_pid(), which returns 0 on failure. Both callers handled 0 before, so behavior should not change, but no automated test covers this path on CI.

@softmaxe
softmaxe enabled auto-merge (squash) October 30, 2026 08:02
@softmaxe
softmaxe merged commit e1fc39f into main Oct 30, 2026
3 checks passed
@softmaxe
softmaxe deleted the refactor/remove-dead-code branch October 30, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant