Open
Conversation
- config.h: use HAVE_UTIL_H on __APPLE__ instead of HAVE_PTY_H (<pty.h> does not exist on macOS, <util.h> provides openpty/forkpty) - atch.h: add #ifdef HAVE_UTIL_H guard to include <util.h> - makefile: STATIC_FLAG is empty on Darwin, -static on Linux (Apple toolchain does not support fully static binaries) Fixes: https://github.com/mobydeck/atch/issues/<building-on-macos>
Variables were declared at block scope but only used in the #else branch, causing -Wunused-variable and -Wunused-but-set-variable warnings on platforms where TIOCSCTTY is defined (e.g. macOS). Move declarations into the #else block where they are actually used. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<util.h>instead of<pty.h>(viaHAVE_UTIL_H/HAVE_PTY_Hinconfig.h)-staticflag conditional in Makefile (disabled on Darwin, macOS doesn't support statically linked binaries)bufandfdinmaster.cto the#elsebranch where they're actually used (fixes-Wunusedwarnings on macOS)Closes #2
Test plan
make clean && makecompiles without errors or warnings on macOS (Apple clang)make clean && makestill compiles on Linux (no regression)Changes
config.h__APPLE__guard →HAVE_UTIL_Hatch.h#ifdef HAVE_UTIL_HincludemakefileUNAME_Sconditional for-staticmaster.cbuf/fdto#elseblock🤖 Generated with Claude Code