Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plank has a bunch of compilation errors? #18

Open
jaredly opened this issue Oct 7, 2024 · 0 comments
Open

plank has a bunch of compilation errors? #18

jaredly opened this issue Oct 7, 2024 · 0 comments

Comments

@jaredly
Copy link

jaredly commented Oct 7, 2024

Maybe my version of gcc is wrong, but here's what I get:

$ make
gcc plan.c -o plan
plan.c:128:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
plan.c:195:3: error: expected expression
  char c = *str;
  ^
plan.c:196:8: error: use of undeclared identifier 'c'
  if (!c) return true;
       ^
plan.c:197:14: error: use of undeclared identifier 'c'
  if (!issym(c)) return false;
             ^
plan.c:205:7: error: expected expression
      char tmp[9] = {0};
      ^
plan.c:206:14: error: use of undeclared identifier 'tmp'
      ((u64*)tmp)[0] = n.direct;
             ^
plan.c:207:21: error: use of undeclared identifier 'tmp'
      if (is_symbol(tmp)) {
                    ^
plan.c:209:35: error: use of undeclared identifier 'tmp'
        strcpy(buf + strlen(buf), tmp);
                                  ^
plan.c:355:7: error: expected expression
      int i = 0;
      ^
plan.c:359:14: error: use of undeclared identifier 'i'
      while (i < n.size) {
             ^
plan.c:360:19: error: use of undeclared identifier 'i'
        if (n.buf[i] == UINT64_MAX) {
                  ^
plan.c:361:19: error: use of undeclared identifier 'i'
          new_buf[i] = 0;
                  ^
plan.c:362:11: error: use of undeclared identifier 'i'
          i++;
          ^
plan.c:365:19: error: use of undeclared identifier 'i'
          new_buf[i] = n.buf[i] + 1;
                  ^
plan.c:365:30: error: use of undeclared identifier 'i'
          new_buf[i] = n.buf[i] + 1;
                             ^
plan.c:366:11: error: use of undeclared identifier 'i'
          i++;
          ^
plan.c:370:11: error: use of undeclared identifier 'i'
      if (i == n.size) {
          ^
plan.c:373:17: error: use of undeclared identifier 'i'
        new_buf[i] = 1;
                ^
plan.c:387:7: error: expected expression
      int i = 0;
      ^
plan.c:391:14: error: use of undeclared identifier 'i'
      while (i < n.size) {
             ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
1 warning and 20 errors generated.
make: *** [plan] Error 1
$ gcc --version
Apple clang version 14.0.0 (clang-1400.0.29.202)
Target: arm64-apple-darwin22.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

When I fix those errors (mostly adding {} around switch cases), it runs, but then fails with an Address boundary error if you try to do anything other than a plain nat.

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

No branches or pull requests

1 participant