[Ur] code bug

Sergey Mironov grrwlf at gmail.com
Mon Sep 30 12:27:01 EDT 2013


Related question: How can I review webapp.c temp file
(/tmp/filestFy18/webapp.c) before compiler deletes it?

Sergey

2013/9/30 Sergey Mironov <grrwlf at gmail.com>:
> Consider following code:
>
> fun noDml (q:dml) : transaction {} =
>   e <- tryDml q;
>   return {}
>
> task initialize = fn {} =>
>   noDml (INSERT INTO page(Id, Caption) VALUES (0, "Top"));
>   noDml (INSERT INTO page(Id, Caption) VALUES (1, "Top"));
>   return {}
>
> When compiling, urweb issues the following error:
>
> dev:[grwlf at greyblade:~/proj/urdesign]$ LANG=C make
> building stamp1
> urweb -dbms sqlite  AppMM
> /tmp/filestFy18/webapp.c:371:37: error: unknown type name 'uw_Basis_dml'
> /tmp/filestFy18/webapp.c: In function 'uw_initializer':
> /tmp/filestFy18/webapp.c:645:29: error: unknown type name 'uw_Basis_dml'
> /tmp/filestFy18/webapp.c:646:30: error: initialization makes integer
> from pointer without a cast [-Werror]
> /tmp/filestFy18/webapp.c:646:30: error: (near initialization for
> '__uwr___2') [-Werror]
> /tmp/filestFy18/webapp.c:648:29: error: implicit declaration of
> function '__uwn_noDml_1781' [-Werror=implicit-function-declaration]
> /tmp/filestFy18/webapp.c:654:31: error: unknown type name 'uw_Basis_dml'
> /tmp/filestFy18/webapp.c:655:32: error: initialization makes integer
> from pointer without a cast [-Werror]
> /tmp/filestFy18/webapp.c:655:32: error: (near initialization for
> '__uwr___3') [-Werror]
> cc1: all warnings being treated as errors
> make: *** [stamp1] Error 1
>
> Note, that if I remove first noDml call, everything would be fine.
> Removing noDml also works
>
> task initialize = fn {} =>
>   e <- tryDml (INSERT INTO page(Id, Caption) VALUES (0, "Top"));
>   e <- tryDml (INSERT INTO page(Id, Caption) VALUES (1, "Top"));
>   return {}
>
> Please, advise
> Sergey



More information about the Ur mailing list