[m-users.] C compiler error

Volker Wysk <[email protected]>
Newsgroups gmane.comp.lang.mercury.general
Message-ID <[email protected]>
Hi.

I have a Mercury module with a lot of foreign C code, and I get many
compiler errors like this:

Making Mercury/os/mq.o
Mercury/cs/mq.c: In function ‘null_to_empty’:
Mercury/cs/mq.c:644:1: error: invalid storage class for function
‘mq_module0’
Mercury/cs/mq.c:644:1: error: invalid storage class for function
‘mq_module0’
Mercury/cs/mq.c:764:1: error: invalid storage class for function
‘mq_module1’
Mercury/cs/mq.c:764:1: error: invalid storage class for function
‘mq_module1’
...



The function in question is this:

:- pragma foreign_code("C",
"
  char * null_to_empty(char * str)
  {
    if (str == 0) {
       MR_String str1 = MR_GC_malloc(1);
       *str1 = (char) 0;
       return str1;
    } else {
       return str;
    }
").


I don't understand what those C compiler options are saying...

Volker

_______________________________________________
users mailing list
[email protected]
https://lists.mercurylang.org/listinfo/users
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEE6QXGh82Ov3+2nrxp+K4ydFOsHoUFAmP8ww0ACgkQ+K4ydFOs
HoWgwQ//WOCPjv/liLqnBsFXykWgLx0Xrht2wz7zQJj3dyUCCdSaJJEoWW+rBKo/
MIypl9atDIk/U6LW7nFeEPgwdFmQ0zaZwD9wMGlpSyfk4hJCmUIG8zZe7V7ole1B
5fkxU52ShlXZYcQ2IibiQqcoEyu8z2NROWyPAz6tw94tMS3e7h7RFQiyWTl5VF5D
Vxq95tuAYbsHK95qM+Ed96FwsRVWlO1bjrww0of+c0BuXd4rI/zrer34a78VkiDm
fwBm7rarvr1MwnNG8pOKH2qg2vmXFYDS1Mn3GOPsn4Lq4r6LE4PQkufjDhAjv0yO
CQ0qqbsnY9fp9+5b99uyyL+CsD1Ue9MmQ2wLlsJAHetmqujl7+GG+jHbBZXcf+Rj
bPjPvcLs6jeb8dESux5f9Djp+oqm9bVFqCXLQrvrx/vGebWx4HcBp7mdsfYLwbhI
GjjrfR1XoeG0rXU6GAnBjJLnXihOWfBBIm8ae2YpvHXFwp4s7Aq33jryh414qM1g
L69tO1Q64LmtCuNptoOrDFuJuepB/ZsZCjs6cJgxiSepHNxFgyPSF3Aq/vohI+Ps
o/E8aiDeOttNYmGqQxkA57v2QAZw8BNBIvuwfhWBFai35bENejcKeJY9wmIrhoWY
S0uKghyy+dNuRHDudD6XLjJnXccJRyWAnymZcboTfpsAtyZzP+8=
=rMOt
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.