Arc Forumnew | comments | leaders | submitlogin
2 points by jsgrahamus 3672 days ago | link | parent

Problem in building

  cc -o mtl-arc -std=c11 mtl-arc.c
  mtl-arc.c: In function ‘new_sym’:
  mtl-arc.c:46:2: warning: implicit declaration of function ‘strdup’ [-Wimplicit-function-declaration]
    symname(result) = strdup(sym);
    ^
  mtl-arc.c:46:18: warning: assignment makes pointer from integer without a cast [enabled by default]
    symname(result) = strdup(sym);
                    ^
  mtl-arc.c: In function ‘new_string’:
  mtl-arc.c:59:20: warning: assignment makes pointer from integer without a cast [enabled by default]
    stringval(result) = strdup(string);
                      ^
  mtl-arc.c: In function ‘new_builtin’:
  mtl-arc.c:118:15: warning: assignment makes pointer from integer without a cast [enabled by default]
    help(result) = strdup(doc);
                 ^
  mtl-arc.c: In function ‘char_to_token’:
  mtl-arc.c:170:2: warning: return makes pointer from integer without a cast [enabled by default]
    return strdup(cbuf);
    ^
  mtl-arc.c: In function ‘split_string’:
  mtl-arc.c:194:20: warning: assignment makes pointer from integer without a cast [enabled by default]
      *(result + i++) = strdup(token);
                      ^
  mtl-arc.c: In function ‘buf_to_string’:
  mtl-arc.c:212:2: warning: return makes pointer from integer without a cast [enabled by default]
    return strdup(buf);
    ^
  mtl-arc.c: In function ‘read_expr’:
  mtl-arc.c:327:4: warning: passing argument 1 of ‘split_string’ makes pointer from integer without a cast [enabled by default]
      char **nums = split_string(strdup(token), '/');
      ^
  mtl-arc.c:181:8: note: expected ‘char *’ but argument is of type ‘int’
   char **split_string(char *a_str, const char a_delim) {
          ^
  /tmp/ccMru0iN.o: In function `builtin_cos':
  mtl-arc.c:(.text+0x3b0e): undefined reference to `sin'
  /tmp/ccMru0iN.o: In function `builtin_expt':
  mtl-arc.c:(.text+0x3bd2): undefined reference to `pow'
  /tmp/ccMru0iN.o: In function `builtin_log':
  mtl-arc.c:(.text+0x3c53): undefined reference to `log'
  /tmp/ccMru0iN.o: In function `builtin_rand':
  mtl-arc.c:(.text+0x3db2): undefined reference to `floor'
  /tmp/ccMru0iN.o: In function `builtin_sin':
  mtl-arc.c:(.text+0x3e46): undefined reference to `sin'
  /tmp/ccMru0iN.o: In function `builtin_sqrt':
  mtl-arc.c:(.text+0x3ec7): undefined reference to `sqrt'
  /tmp/ccMru0iN.o: In function `builtin_tan':
  mtl-arc.c:(.text+0x3f48): undefined reference to `tan'
  /tmp/ccMru0iN.o: In function `builtin_trunc':
  mtl-arc.c:(.text+0x3fc9): undefined reference to `trunc'
  collect2: error: ld returned 1 exit status
  make: *** [all] Error 1


2 points by c-a-smallwood 3669 days ago | link

I apologize, I must admit I am terrible at creating Makefiles... I'll make fixing it top priority.

Among other things, I recently added a prototype curly-infix reader, which has been kind of fun coding with, because it makes math bearable, and it makes certain things easier to read. Along with variable negation, it seems quite handy.

examples:

(def isa (a b) {type.a is b}) => (def isa (a b) (is (type a) b))

{caar = [car car._]} => (= caar (fn (_) (car (car _))))

{1 + 2 + 3 - 4 - 5} => (- (+ 1 2 3) 4 5)

-----

2 points by c-a-smallwood 3668 days ago | link

It should build now

-----