Error 4 error C2440: 'initializing' : cannot convert from 'void *' to 'char *' - compilation

I tried to compile this and got mistakes such as:
Error 4 error C2440: 'initializing' : cannot convert from 'void *' to 'char *'
This code is taken from here. Why doesn't it work?
DWORD dwRead=0;
char *lpData = (VOID*)GlobalAlloc(GMEM_FIXED, MAX_READ),

You appear to be compiling with a C++ compiler, so you'll need an explicit cast:
char *lpData = (char *)GlobalAlloc(GMEM_FIXED, MAX_READ);

Related

How can I resolve errors when installing the github-markdown gem?

When installing the github-markdown 0.6.9 gem, the following errors are raised:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/Moth/.rvm/gems/ruby-2.6.6#searchgov-rails42/gems/github-markdown-0.6.9/ext/markdown
/Users/Moth/.rvm/rubies/ruby-2.6.6/bin/ruby -I /Users/Moth/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r
./siteconf20210820-81082-7n7xnz.rb extconf.rb
creating Makefile
current directory: /Users/Moth/.rvm/gems/ruby-2.6.6#searchgov-rails42/gems/github-markdown-0.6.9/ext/markdown
make "DESTDIR=" clean
current directory: /Users/Moth/.rvm/gems/ruby-2.6.6#searchgov-rails42/gems/github-markdown-0.6.9/ext/markdown
make "DESTDIR="
compiling autolink.c
compiling buffer.c
compiling gh-markdown.c
gh-markdown.c:56:29: error: implicitly declaring library function 'isspace' with type 'int (int)'
[-Werror,-Wimplicit-function-declaration]
while (i < lang->size && !isspace(lang->data[i]))
^
gh-markdown.c:56:29: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
gh-markdown.c:60:14: warning: assigning to 'const char *' from 'uint8_t *' (aka 'unsigned char *') converts between
pointers to integer types with different sign [-Wpointer-sign]
lang_name = lang->data + 1;
^ ~~~~~~~~~~~~~~
gh-markdown.c:63:14: warning: assigning to 'const char *' from 'uint8_t *const' (aka 'unsigned char *const') converts
between pointers to integer types with different sign [-Wpointer-sign]
lang_name = lang->data;
^ ~~~~~~~~~~
gh-markdown.c:71:5: warning: passing 'uint8_t *const' (aka 'unsigned char *const') to parameter of type 'const char *'
converts between pointers to integer types with different sign [-Wpointer-sign]
geefem_str_new(text->data, text->size),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gh-markdown.c:21:35: note: expanded from macro 'geefem_str_new'
# define geefem_str_new(str, len) rb_enc_str_new(str, len, rb_utf8_encoding())
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:158:24: note: expanded from macro 'rb_enc_str_new'
rb_enc_str_new_static((str), (len), (enc)) : \
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/defines.h:116:53: note: expanded from macro
'RB_GNUC_EXTENSION_BLOCK'
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/ruby.h:2588:40: note: expanded from macro 'rb_yield_values'
const VALUE rb_yield_values_args[] = {__VA_ARGS__}; \
^~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:140:40: note: passing argument to parameter here
VALUE rb_enc_str_new_static(const char*, long, rb_encoding*);
^
gh-markdown.c:71:5: warning: passing 'uint8_t *const' (aka 'unsigned char *const') to parameter of type 'const char *'
converts between pointers to integer types with different sign [-Wpointer-sign]
geefem_str_new(text->data, text->size),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gh-markdown.c:21:35: note: expanded from macro 'geefem_str_new'
# define geefem_str_new(str, len) rb_enc_str_new(str, len, rb_utf8_encoding())
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:159:17: note: expanded from macro 'rb_enc_str_new'
rb_enc_str_new((str), (len), (enc)) \
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/defines.h:116:53: note: expanded from macro
'RB_GNUC_EXTENSION_BLOCK'
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/ruby.h:2588:40: note: expanded from macro 'rb_yield_values'
const VALUE rb_yield_values_args[] = {__VA_ARGS__}; \
^~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:138:33: note: passing argument to parameter here
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
^
gh-markdown.c:82:3: error: implicit declaration of function 'houdini_escape_html0' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
houdini_escape_html0(ob, lang_name, lang_size, 0);
^
gh-markdown.c:89:2: error: implicit declaration of function 'houdini_escape_html0' is invalid in C99
[-Werror,-Wimplicit-function-declaration]
houdini_escape_html0(ob, text->data, text->size, 0);
^
gh-markdown.c:122:33: warning: passing 'char *' to parameter of type 'const uint8_t *' (aka 'const unsigned char *')
converts between pointers to integer types with different sign [-Wpointer-sign]
sd_markdown_render(output_buf, RSTRING_PTR(rb_text), RSTRING_LEN(rb_text), md);
^~~~~~~~~~~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/ruby.h:1003:5: note: expanded from macro 'RSTRING_PTR'
(!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./markdown.h:124:51: note: passing argument to parameter 'document' here
sd_markdown_render(struct buf *ob, const uint8_t *document, size_t doc_size, struct sd_markdown *md);
^
gh-markdown.c:125:12: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts
between pointers to integer types with different sign [-Wpointer-sign]
rb_text = geefem_str_new(output_buf->data, output_buf->size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gh-markdown.c:21:35: note: expanded from macro 'geefem_str_new'
# define geefem_str_new(str, len) rb_enc_str_new(str, len, rb_utf8_encoding())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:158:24: note: expanded from macro 'rb_enc_str_new'
rb_enc_str_new_static((str), (len), (enc)) : \
~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/defines.h:116:53: note: expanded from macro
'RB_GNUC_EXTENSION_BLOCK'
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:140:40: note: passing argument to parameter here
VALUE rb_enc_str_new_static(const char*, long, rb_encoding*);
^
gh-markdown.c:125:12: warning: passing 'uint8_t *' (aka 'unsigned char *') to parameter of type 'const char *' converts
between pointers to integer types with different sign [-Wpointer-sign]
rb_text = geefem_str_new(output_buf->data, output_buf->size);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gh-markdown.c:21:35: note: expanded from macro 'geefem_str_new'
# define geefem_str_new(str, len) rb_enc_str_new(str, len, rb_utf8_encoding())
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:159:17: note: expanded from macro 'rb_enc_str_new'
rb_enc_str_new((str), (len), (enc)) \
~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/defines.h:116:53: note: expanded from macro
'RB_GNUC_EXTENSION_BLOCK'
#define RB_GNUC_EXTENSION_BLOCK(x) __extension__ ({ x; })
^
/Users/Moth/.rvm/rubies/ruby-2.6.6/include/ruby-2.6.0/ruby/encoding.h:138:33: note: passing argument to parameter here
VALUE rb_enc_str_new(const char*, long, rb_encoding*);
^
7 warnings and 3 errors generated.
make: *** [gh-markdown.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/Moth/.rvm/gems/ruby-2.6.6#searchgov-rails42/gems/github-markdown-0.6.9 for
inspection.
Results logged to
/Users/Moth/.rvm/gems/ruby-2.6.6#searchgov-rails42/extensions/x86_64-darwin-19/2.6.0/github-markdown-0.6.9/gem_make.out
An error occurred while installing github-markdown (0.6.9), and Bundler cannot continue.
Make sure that `gem install github-markdown -v '0.6.9' --source 'https://rubygems.org/'` succeeds before bundling.
I was able to successfully install the github-markdown gem with the following flags:
gem install github-markdown -v '0.6.9' --source 'https://rubygems.org/' -- --with-cflags="-Wno-error=implicit-function-declaration"

Swoole make failed ubuntu16.04

I am trying to install SWOOLE on my Ubuntu-16.04
I tried this sudo pecl install swoole
But am getting a long list of errors(Skipped some lines)
In file included from /tmp/pear/temp/swoole/php_swoole.h:156:0,
from /tmp/pear/temp/swoole/swoole.c:16:
/tmp/pear/temp/swoole/php7_wrapper.h: In function 'sw_zend_is_callable':
/tmp/pear/temp/swoole/php7_wrapper.h:238:5: error: unknown type name 'zend_string'
zend_string *key = NULL;
^
/tmp/pear/temp/swoole/php7_wrapper.h:239:5: warning: passing argument 3 of 'zend_is_callable' from incompatible pointer type [enabled by default]
int ret = zend_is_callable(cb, a, &key);
^
In file included from /usr/include/php5/main/php.h:39:0,
from /tmp/pear/temp/swoole/php_swoole.h:25,
from /tmp/pear/temp/swoole/swoole.c:16:
/usr/include/php5/Zend/zend_API.h:301:20: note: expected 'char **' but argument is of type 'int **'
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name TSRMLS_DC);
^
In file included from /usr/include/php5/Zend/zend.h:252:0,
from /usr/include/php5/main/php.h:35,
from /tmp/pear/temp/swoole/php_swoole.h:25,
from /tmp/pear/temp/swoole/swoole.c:16:
/tmp/pear/temp/swoole/php7_wrapper.h:240:29: error: request for member 'val' in something not a structure or union
char *tmp = estrndup(key->val, key->len);
^
/usr/include/php5/Zend/zend_alloc.h:78:44: note: in definition of macro 'estrndup'
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
^
/tmp/pear/temp/swoole/php7_wrapper.h:240:39: error: request for member 'len' in something not a structure or union
char *tmp = estrndup(key->val, key->len);
^
/usr/include/php5/Zend/zend_alloc.h:78:49: note: in definition of macro 'estrndup'
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
^
In file included from /tmp/pear/temp/swoole/php_swoole.h:156:0,
from /tmp/pear/temp/swoole/swoole.c:16:
/tmp/pear/temp/swoole/php7_wrapper.h: In function 'sw_zend_is_callable_ex':
/tmp/pear/temp/swoole/php7_wrapper.h:248:5: error: unknown type name 'zend_string'
zend_string *key = NULL;
^
/tmp/pear/temp/swoole/php7_wrapper.h:249:5: warning: passing argument 4 of 'zend_is_callable_ex' from incompatible pointer type [enabled by default]
int ret = zend_is_callable_ex(callable, NULL, check_flags, &key, fcc, error);
make: *** [swoole.lo] Error 1
ERROR: `make' failed
I have also tried this
cd swoole-src
./configure
make
Which is also giving the similar errors.
How to solve this? thanks in advance!
EDIT : Added the first Generated ERRORS too

Multiple errors when compiling wxWidgets with gcc 4.8.1

I've been trying for a while now compile wxWidgets library for Code::Blocks and I am still getting a lot of different errors.
My gcc verions is: gcc (tdm-2) 4.8.1 and I want to build newest wxWidgets: 3.1.0. I've tried 3 different sources and each time I have some error (sometimes this same, sometimes different). I am working on Windows 8.1.
[1]mingw32-make -f makefile.gcc UNICODE=1 MONOLITHIC=1 SHARED=1 BUILD=debug CXXFLAGS="-std=gnu++11"
and the error output:
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:623:47: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:623:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:632:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
}
^
makefile.gcc:6786: recipe for target 'gcc_mswuddll\monodll_wxcrt.o' failed
mingw32-make: *** [gcc_mswuddll\monodll_wxcrt.o] Error 1
[2]mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=debug and the error output:
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:623:47: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:623:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:632:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
}
^
makefile.gcc:11860: recipe for target 'gcc_mswuddll\basedll_wxcrt.o' failed
mingw32-make: *** [gcc_mswuddll\basedll_wxcrt.o] Error 1
[3]mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport"1 and the error:
../../src/common/wxcrt.cpp: In function 'int wxVsprintf(wchar_t*, const wxString
&, va_list)':
../../src/common/wxcrt.cpp:623:47: error: invalid conversion from 'const wchar_t
*' to 'size_t {aka unsigned int}' [-fpermissive]
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:623:56: error: cannot convert 'va_list {aka char*}' t
o 'const wchar_t*' for argument '3' to 'int vswprintf(wchar_t*, size_t, const wc
har_t*, char*)'
return wxCRT_VsprintfW(str, format.wc_str(), argptr);
^
../../src/common/wxcrt.cpp:632:1: warning: control reaches end of non-void funct
ion [-Wreturn-type]
}
^
makefile.gcc:6786: recipe for target 'gcc_mswudll\monodll_wxcrt.o' failed
mingw32-make: *** [gcc_mswudll\monodll_wxcrt.o] Error 1
Can someone please advice me what more I can do?
I'm not sure why are you speaking about multiple errors, this is clearly one and the same error and is due to using standard-like vswprintf() instead of the function from MSVC CRT which is normally used by MinGW by default. The former should only be used when __USE_MINGW_ANSI_STDIO is in effect and it's very strange that you still get it without it, I wonder if you have CPPFLAGS or similar set in your environment?
Anyhow, I'd recommend using TDM-GCC 4.9 as 3.1.0 definitely compiles with it (this is what the official binaries have been built with). 4.8 is supposed to work too, of course, so it could be worth checking how is __USE_MINGW_ANSI_STDIO getting defined, but installing 4.9 will probably be simpler for you.

cannot convert parameter from 'PCHAR' to 'LPCWSTR'

I have defined the pointer size_Drive as :
PCHAR size_Drive ;
then i used the function lstrlen :
size_Drive += (lstrlen(size_Drive) + 1) ; (line 28)
but it gives me the following ERROR :
1>c:\users\hp.hp-pc\documents\visual studio 2008\projects\getvolumeinfo\getvolumeinfo\getvolumeinfo.cpp(28) : error C2664: 'lstrlenW' : cannot convert parameter 1 from 'PCHAR' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
PCHAR is a typedef for char whereas LPCWSTR is a typedef for const wchar_t*, and in a Unicode build lstrlen is a macro for the Unicode function lstrlenW.
You should call lstrlenA specifically to use the ANSI function.

Ruby DevKit compile issues

My compass had broken
>compass compile
LoadError on line ["36"] of C: cannot load such file -- zurb-foundation
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.2/lib/compass/configuration/data.rb:161:in `requi
re'
C:/www/project/config.rb:2:in `get_binding'
[...]
so I decided it was time to reinstall Ruby. Downloaded and installed rubyinstaller-1.9.3-p385.exe. It told me to also install the DevKit.
But gem install rdiscount --platform=ruby didn't go so well:
C:/Ruby193/bin/ruby.exe extconf.rb
checking for random()... no
checking for srandom()... no
checking for rand()... yes
checking for srand()... yes
checking size of unsigned long... 4
checking size of unsigned int... 4
creating Makefile
make
generating rdiscount-i386-mingw32.def
compiling basename.c
compiling Csio.c
Csio.c: In function 'Csputc':
Csio.c:14:5: warning: operation on 'iot->size' may be undefined
compiling css.c
css.c: In function 'mkd_css':
css.c:57:6: warning: operation on 'f.size' may be undefined
compiling docheader.c
compiling dumptree.c
dumptree.c: In function 'Pptype':
dumptree.c:23:22: warning: return discards qualifiers from pointer target type
[...]
dumptree.c:37:22: warning: return discards qualifiers from pointer target type
dumptree.c: In function 'pushpfx':
dumptree.c:44:24: warning: operation on 'sp->size' may be undefined
dumptree.c: In function 'dumptree':
dumptree.c:104:5: warning: initialization discards qualifiers from pointer target type
dumptree.c:104:5: warning: initialization discards qualifiers from pointer target type
compiling emmatch.c
emmatch.c: In function 'emfill':
emmatch.c:79:4: warning: operation on 'p->b_text.size' may be undefined
compiling generate.c
generate.c: In function 'push':
generate.c:37:2: warning: operation on 'f->in.size' may be undefined
generate.c: In function 'Qchar':
generate.c:120:9: warning: operation on 'f->Q.size' may be undefined
generate.c:127:5: warning: operation on 'cur->b_text.size' may be undefined
generate.c: In function 'Qem':
generate.c:172:17: warning: operation on 'f->Q.size' may be undefined
generate.c:179:13: warning: operation on 'f->Q.size' may be undefined
generate.c: In function '___mkd_reparse':
generate.c:197:5: warning: operation on 'sub.in.size' may be undefined
generate.c: In function 'puturl':
generate.c:228:6: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:230:6: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:232:6: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:236:6: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:238:6: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: At top level:
generate.c:458:5: warning: initialization discards qualifiers from pointer target type
generate.c:459:5: warning: initialization discards qualifiers from pointer target type
generate.c:460:5: warning: initialization discards qualifiers from pointer target type
generate.c:461:5: warning: initialization discards qualifiers from pointer target type
generate.c: In function 'isautoprefix':
generate.c:473:29: warning: comparison between signed and unsigned integer expressions
generate.c: At top level:
generate.c:497:1: warning: initialization discards qualifiers from pointer target type
[...]
generate.c:514:5: warning: initialization discards qualifiers from pointer target type
generate.c: In function 'pseudo':
generate.c:527:30: warning: comparison between signed and unsigned integer expressions
generate.c: In function 'p_or_nothing':
generate.c:575:5: warning: return discards qualifiers from pointer target type
generate.c: In function 'extra_linky':
generate.c:594:3: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'linkyformat':
generate.c:632:6: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:633:6: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:637:6: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'cputc':
generate.c:733:5: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:734:5: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:735:5: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'mangle':
generate.c:748:2: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
[...]
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: At top level:
generate.c:1085:5: warning: initialization discards qualifiers from pointer target type
[...]
generate.c: In function 'smartypants':
generate.c:1119:18: warning: comparison between signed and unsigned integer expressions
generate.c:1122:3: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1144:8: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1146:8: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'text':
generate.c:1208:2: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1212:4: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
[...]
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: At top level:
generate.c:1372:1: warning: initialization discards qualifiers from pointer target type
generate.c:1372:1: warning: initialization discards qualifiers from pointer target type
generate.c:1372:1: warning: initialization discards qualifiers from pointer target type
generate.c:1373:7: warning: initialization discards qualifiers from pointer target type
generate.c: In function 'splat':
generate.c:1384:5: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1395:6: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
[...]
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'printblock':
generate.c:1475:5: warning: initialization discards qualifiers from pointer target type
generate.c:1475:5: warning: initialization discards qualifiers from pointer target type
generate.c:1475:5: warning: initialization discards qualifiers from pointer target type
generate.c:1476:5: warning: initialization discards qualifiers from pointer target type
generate.c:1476:5: warning: initialization discards qualifiers from pointer target type
generate.c:1476:5: warning: initialization discards qualifiers from pointer target type
generate.c:1484:3: warning: passing argument 1 of 'push' discards qualifiers from pointer target type
generate.c:34:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1490:7: warning: passing argument 1 of 'push' discards qualifiers from pointer target type
generate.c:34:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'printcode':
generate.c:1507:5: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1519:5: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'htmlify':
generate.c:1546:2: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1551:2: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1555:3: warning: passing argument 2 of 'Qprintf' discards qualifiers from pointer target type
generate.c:155:1: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'definitionlist':
generate.c:1566:2: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1570:3: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1572:3: warning: passing argument 1 of 'Qstring' discards qualifiers from pointer target type
generate.c:135:1: note: expected 'char *' but argument is of type 'const char *'
generate.c:1575:6: warning: passing argument 2 of 'htmlify' discards qualifiers from pointer target type
[...]
cstring.h:73:12: note: expected 'char *' but argument is of type 'const char *'
generate.c: In function 'mkd_document':
generate.c:1710:6: warning: operation on 'p->ctx->out.size' may be undefined
compiling html5.c
html5.c: In function 'mkd_with_html5_tags':
html5.c:15:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
html5.c:16:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
html5.c:17:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
html5.c:18:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
html5.c:19:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
html5.c:20:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
html5.c:21:5: warning: passing argument 1 of 'mkd_define_tag' discards qualifiers from pointer target type
tags.h:17:6: note: expected 'char *' but argument is of type 'const char *'
compiling markdown.c
markdown.c:104:15: warning: initialization discards qualifiers from pointer target type
markdown.c: In function 'quoteblock':
markdown.c:743:17: warning: initialization discards qualifiers from pointer target type
markdown.c:751:12: warning: assignment discards qualifiers from pointer target type
markdown.c: In function 'addfootnote':
markdown.c:955:23: warning: operation on 'f->footnotes->size' may be undefined
markdown.c:963:2: warning: operation on 'foot->tag.size' may be undefined
markdown.c:965:5: warning: operation on 'foot->tag.size' may be undefined
markdown.c:971:6: warning: operation on 'foot->title.size' may be undefined
markdown.c:976:2: warning: operation on 'foot->link.size' may be undefined
markdown.c:977:5: warning: operation on 'foot->link.size' may be undefined
markdown.c:1004:6: warning: operation on 'foot->title.size' may be undefined
markdown.c:1010:2: warning: operation on 'foot->title.size' may be undefined
compiling mkdio.c
mkdio.c: In function 'queue':
mkdio.c:59:3: warning: operation on 'p->text.size' may be undefined
mkdio.c:63:6: warning: operation on 'p->text.size' may be undefined
mkdio.c:67:5: warning: operation on 'p->text.size' may be undefined
mkdio.c: In function 'populate':
mkdio.c:113:6: warning: operation on 'line.size' may be undefined
mkdio.c: In function 'mkd_line':
mkdio.c:275:2: warning: operation on 'f.out.size' may be undefined
compiling rdiscount.c
In file included from c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windows.h:48:0,
from c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/winsock2.h:22,
from c:/Ruby193/include/ruby-1.9.1/ruby/win32.h:40,
from c:/Ruby193/include/ruby-1.9.1/ruby/defines.h:223,
from c:/Ruby193/include/ruby-1.9.1/ruby/ruby.h:67,
from c:/Ruby193/include/ruby-1.9.1/ruby.h:32,
from rdiscount.c:2:
c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:229:23: error: duplicate 'unsigned'
c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:238:23: error: duplicate 'unsigned'
c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:238:23: error: two or more data types in declaration specifiers
c:\ruby193\devkit\mingw\bin\../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:241:24: error: duplicate 'unsigned'
rdiscount.c: In function 'rb_rdiscount_to_html':
rdiscount.c:18:5: warning: implicit declaration of function 'rb_rdiscount__get_flags'
rdiscount.c:18:5: warning: ISO C90 forbids mixed declarations and code
rdiscount.c: In function 'rb_rdiscount_toc_content':
rdiscount.c:55:5: warning: ISO C90 forbids mixed declarations and code
make: *** [rdiscount.o] Error 1
I've tried uninstalling Ruby and removing the C:/Ruby193 directory, but the same errors still occurs.
I was hoping that I could just gem install compass and be on my way, but I still get the same error when I run compass compile.
Do you know how to fix this?
Looks like there is an issue with the latest version of rdiscount: https://github.com/rtomayko/rdiscount/issues/74
Try installing the previously tagged version:
gem install rdiscount -v=1.6.8 --platform=ruby

Resources