Skip to content

Conversation

robertoraggi
Copy link
Owner

Enough for

int puts(const char*);

int main() {
  char* s = "hello";
  puts(s);
  puts("hello");

  char a[10];
  a[0] = 'a';
  a[1] = 'b';
  a[2] = 'c';
  a[3] = '\0';
  puts(a);
  return 0;
}
$ cxx -c x.c -toolchain macos 

$ ld x.o -syslibroot /Library/Developer/CommandLineTools/SDKs/MacOSX15.sdk -lSystem

$ /a.out 

hello
hello
abc

Signed-off-by: Roberto Raggi <roberto.raggi@gmail.com>
@robertoraggi robertoraggi merged commit 68f981c into main Aug 12, 2025
9 checks passed
@robertoraggi robertoraggi deleted the used-baboon branch August 12, 2025 18:26
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