title: incompatible pointer types passing 'char *(char *)' to parameter of type 'VALUE (*)()'
body: <p>I need to extend my ruby code using C code. I have this function on my c file:</p>
  
  <pre><code>char * generateIt(char *valor) {
    struct NESSIEstruct w;
    u8 digest[DIGESTBYTES];
  
    int i;
    for(i=0; valor[i]!='\0'; ++i);
    int sizeo = i;
  
    NESSIEinit(&amp;w);
    NESSIEadd((u8*)valor, 8*sizeo, &amp;w);
    NESSIEfinalize(&amp;w, digest);
    return displayIt(digest, DIGESTBYTES);
  }
  </code></pre>
  
  <p>And to make it available to Ruby, at the same file, I have this:</p>
  
  <pre><code>void
  Init_whirlpool(){
    rb_mWhirlpool = rb_define_module("Whirlpool");
    rb_cClass = rb_define_class_under(rb_mWhirlpool, "Class", rb_cObject);
    rb_define_method(rb_cClass, "generate", generateIt, 1);
  }
  </code></pre>
  
  <p>But, when I try do run: make, I get this warning:</p>
  
  <blockquote>
    <p>MacBook-Pro-de-Patricio:whirlpool psantos$ make compiling whirlpool.c
    whirlpool.c:2021:43: warning: incompatible pointer types passing 'char
    *(char <em>)' to parameter of type 'VALUE (</em>)()' [-Wincompatible-pointer-types]   rb_define_method(rb_cClass,
    "generate", generateIt, 1);
                                              ^~~~~~~~~~ /Users/psantos/.rvm/rubies/ruby-2.0.0-p598/include/ruby-2.0.0/ruby/ruby.h:1290:48:
    note: passing argument to parameter here void
    rb_define_method(VALUE,const char*,VALUE(*)(ANYARGS),int);
                                                   ^ 1 warning generated.</p>
  </blockquote>
  
  <p>Error image: (to be more clear)</p>
  
  <p><img src="https://i.stack.imgur.com/4NewM.png" alt="enter image description here"></p>
  
  <p>How can I solve this?</p>