Skip to content
This repository has been archived by the owner on Mar 4, 2019. It is now read-only.

Warning compiling program.c with ARGS #35

Open
joaquimg opened this issue Oct 23, 2017 · 1 comment
Open

Warning compiling program.c with ARGS #35

joaquimg opened this issue Oct 23, 2017 · 1 comment

Comments

@joaquimg
Copy link

I copied from program2.c the follwing step:

  jl_value_t *type = jl_apply_array_type(jl_string_type, 1);
  jl_array_t *ARGS = jl_alloc_array_1d(type, 0);
  JL_GC_PUSH1(&ARGS);
  jl_array_grow_end(ARGS, argc - 1);
  for (i = 1; i < argc; i++) {
      jl_value_t *s = (jl_value_t*)jl_cstr_to_string(argv[i]);
      jl_arrayset(ARGS, s, i - 1);
  }

I keep getting this warning:

D:\myprog\compile2\program.c: In function 'main':
D:\myprog\compile2\program.c:68:42: warning: passing argument 1 of 'jl_apply_array_type' from incompatible pointer type [-Wincompatible-pointer-types]
   jl_value_t *type = jl_apply_array_type(jl_string_type, 1);
                                          ^~~~~~~~~~~~~~
In file included from D:\myprog\compile2\program.c:17:0:
D:\myprog\deps\julia\julia-0.6.0-win64\include\julia/julia.h:1199:26: note: expected 'jl_value_t * {aka struct _jl_value_t *}' but argument is of type 'jl_datatype_t * {aka struct _jl_datatype_t *}'
 JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim);
                          ^~~~~~~~~~~~~~~~~~~

everything seems to work though.

I am using x86_64-w64-mingw32-gcc from MSYS2 in windows 10 64bits.
With julia-0.6.0 64bits and the current master of this script.

@joaquimg
Copy link
Author

I get the following on Linux 64 bits with julia 0.6.0-64bits:

/home/user/myprog.jl/compile/program.c: In function ‘main’:
/home/user/myprog.jl/compile/program.c:71:3: warning: passing argument 1 of ‘jl_apply_array_type’ from incompatible pointer type [enabled by default]
   jl_value_t *type = jl_apply_array_type(jl_string_type, 1);
   ^
In file included from /home/user/myprog.jl/compile/program.c:17:0:
/home/user/julia-903644385b/include/julia/julia.h:1199:26: note: expected ‘struct jl_value_t *’ but argument is of type ‘struct jl_datatype_t *’
 JL_DLLEXPORT jl_value_t *jl_apply_array_type(jl_value_t *type, size_t dim);
                          ^

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant