Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

that's ... (amazing|C for ya)

  int foo() {
      return 0;
  }
  int main(int argc, char* argv[]) {
      return foo("alpha", "beta", 1);
  }
  $ gcc-13 -Wall -Werror -o foo foo.c
  # oh, sads

  $ clang -o foo ./foo.c
  ./foo.c:5:34: warning: too many arguments in call to 'foo'
      return foo("alpha", "beta", 1);
             ~~~                   ^
  ./foo.c:5:15: warning: passing arguments to 'foo' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
      return foo("alpha", "beta", 1);
                ^
  2 warnings generated.


Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: