Hi Hongwei, I change the code as following:
https://github.com/jats-ug/practice-ats/commit/48e2215d2017123d8eb0091f050cb95b5334a885 However, I catch error at C language side. ``` $ patscc -o a.out main.dats -DATS_MEMALLOC_LIBC In file included from main_dats.c:15:0: main_dats.c: In function ‘_057_home_057_kiwamu_057_src_057_practice_055_ats_057_template_struct_057_gen_056_sats__struct_foo_get_b__3__1’: /home/kiwamu/src/ATS-Postiats/ccomp/runtime/pats_ccomp_instrset.h:207:29: warning: dereferencing ‘void *’ pointer #define ATSderef(pmv, hit) (*(hit*)pmv) /home/kiwamu/src/ATS-Postiats/ccomp/runtime/pats_ccomp_instrset.h:329:34: note: in definition of macro ‘ATSINSstore’ #define ATSINSstore(pmv1, pmv2) (pmv1 = pmv2) ^~~~ main_dats.c:1101:13: note: in expansion of macro ‘ATSderef’ ATSINSstore(ATSderef(arg0, atsvoid_t0ype), ATSPMVcastfn(addback_struct_foo, atstkind_type(atstype_ptrk), ATSPMVcastfn(takeout_struct_foo, atstkind_type(atstype_ptrk), ar g0))) ; ^~~~~~~~ main_dats.c:1101:1: error: invalid use of void expression ATSINSstore(ATSderef(arg0, atsvoid_t0ype), ATSPMVcastfn(addback_struct_foo, atstkind_type(atstype_ptrk), ATSPMVcastfn(takeout_struct_foo, atstkind_type(atstype_ptrk), ar g0))) ; ^~~~~~~~~~~ ``` I think the generated C code casts it into `void`. Why not `void *`? Best regards, -- Kiwamu Okabe -- You received this message because you are subscribed to the Google Groups "ats-lang-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/ats-lang-users. To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dkQBP_nV6QiHQGZ%2Bvxs2tU5K33EyxZNNfYHrCCdHuLeXQ%40mail.gmail.com.
