title: Error: Assigning to char* from incompatible type void*
body: <p>So I'm trying to store a response from a libcURL HTTP request into a C-string to be parsed later on. The response code is written entirely in C, while everything else is in C++, and with any other C++ compiler, it should work fine. But when I try to compile, even if I give the '-x c' arguments followed by the filename, I get these specific responses.</p>
  
  <pre><code>g++ main.cpp -x c cJSON.c -x c respbuffer.c -lcurl -lm
  
  ./respbuffer.c:14:9: error: assigning to 'char *' from incompatible type 'void *'
      s-&gt;ptr = malloc(s-&gt;len+1);
             ^ ~~~~~~~~~~~~~~~~
  ./respbuffer.c:23:9: error: assigning to 'char *' from incompatible type 'void *'
      s-&gt;ptr = realloc(s-&gt;ptr, new_len+1);
             ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
  </code></pre>
  
  <p>Weirdly enough, this error only pops up when compiling with g++. If I use gcc, it works fine, and it runs smoothly enough. For the curious, I wrote everything in Xcode, and I'm compiling with GCC 4.2.1.</p>