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

Build error with clang: mgd.c: error: call to undeclared function 'failwith', etc. #71

Open
barracuda156 opened this issue Jul 26, 2023 · 1 comment

Comments

@barracuda156
Copy link

  make[1]: Entering directory `/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_lang_mosml/mosml-dynlibs/work/mosml-13c581aec46eea134e478f2e2b6456278e36ecce/src/dynlibs/mgd'
  /opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_lang_mosml/mosml-dynlibs/work/compwrap/cc/usr/bin/clang -Dunix -O2 -fno-defer-pop -fPIC -I/opt/local/include/mosml -I/opt/local/include -c -o mgd.o mgd.c
  clang: warning: optimization flag '-fno-defer-pop' is not supported [-Wignored-optimization-argument]
  mgd.c:82:5: error: call to undeclared function 'failwith'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      failwith("Could not create image");
      ^
  mgd.c:96:5: error: call to undeclared function 'failwith'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      failwith("Cannot open PNG file for input");
      ^
  mgd.c:112:5: error: call to undeclared function 'failwith'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      failwith("Cannot open PNG file for output");
      ^
  mgd.c:127:3: error: call to undeclared function 'flush'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    flush(stdout);
    ^
  mgd.c:127:3: note: did you mean 'fflush'?
  /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/stdio.h:146:6: note: 'fflush' declared here
  int      fflush(FILE *);
           ^
  mgd.c:167:3: error: call to undeclared function 'modify'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    modify(&Field(res, 0), Val_long(color));
    ^
  mgd.c:184:10: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
  { return Val_long(gdTransparent); }
           ^~~~~~~~~~~~~~~~~~~~~~~
  /opt/local/include/mosml/mlvalues.h:63:37: note: expanded from macro 'Val_long'
  #define Val_long(x)     (((long)(x) << 1) + 1)
                            ~~~~~~~~~ ^
  mgd.c:189:10: warning: shifting a negative signed value is undefined [-Wshift-negative-value]
  { return Val_long(gdBrushed); }
           ^~~~~~~~~~~~~~~~~~~
@barracuda156
Copy link
Author

make[1]: Entering directory `/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mosml/mosml-dynlibs/work/mosml-13c581aec46eea134e478f2e2b6456278e36ecce/src/dynlibs/mmysql'
/opt/local/var/macports/build/_opt_PPCSnowLeopardPorts_lang_mosml/mosml-dynlibs/work/compwrap/cc/opt/local/bin/gcc-mp-12 -Dunix -O2 -fno-defer-pop -I/opt/local/include/mosml -I /opt/local/include/mysql57/mysql -c -o mmysql.o mmysql.c
mmysql.c: In function 'dbresult_finalize':
mmysql.c:79:28: error: lvalue required as left operand of assignment
   79 |     DBresult_val(dbresval) = NULL;
      |                            ^
mmysql.c:81:33: error: lvalue required as left operand of assignment
   81 |     DBresultindex_val(dbresval) = NULL;
      |                                 ^

This one has been reported much earlier, but looks like still unfixed: https://trac.macports.org/ticket/39664

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