Trying to call `patsopt_version` in the following simple program:

#include "share/atspre_define.hats"
#include "share/atspre_staload.hats"

implement main0 () = (
  println!(patsopt_version());
  exit_errmsg_void (0, "foo\n")
)

generates the compiler error:

/tmp/cc8XdQB8.o: In function `mainats_void_0':
patsver_dats.c:(.text+0x181): undefined reference to `atspre_patsopt_version
'
collect2: error: ld returned 1 exit status

and a couple warnings:

patsver_dats.c: In function ‘mainats_void_0’:
patsver_dats.c:343:1: warning: implicit declaration of function ‘
atspre_patsopt_version’ [-Wimplicit-function-declaration]
 ATSINSmove(tmp2, atspre_patsopt_version()) ;
 ^
In file included from patsver_dats.c:15:0:
/home/spearman/ats/remote/ATS2-Postiats/ccomp/runtime/pats_ccomp_instrset.h:
270:35: warning: assignment makes pointer from integer without a cast [enabled 
by default]
 #define ATSINSmove(tmp, val) (tmp = val)
                                   ^
patsver_dats.c:343:1: note: in expansion of macro ‘ATSINSmove’
 ATSINSmove(tmp2, atspre_patsopt_version()) ;
 ^

Commenting out the line to call `patsopt_version` compiles and runs 
successfully emitting the exit message.

-- 
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 ats-lang-users+unsubscr...@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
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/b0b17fed-0eae-4113-95cf-3f93b266571c%40googlegroups.com.

Reply via email to