dino-lang / dino

The programming language DINO
GNU General Public License v2.0
71 stars 5 forks source link

Compiler warnings in ONIGURUMA/sample files #5

Closed teshields closed 8 years ago

teshields commented 8 years ago

Environment: Mac OS X El Capitan version 10.11.5 (current) Xcode version 7.3.1 (current)

Adding the cast '(OnigUChar *)' to the first parameter in the invocation of 'onig_error_code_to_str()' on the source lines noted below eliminates the compiler warnings.

ONIGURUMA/sample/encode.c:

encode.c:34:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r); encode.c:60:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); encode.c:107:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo);

ONIGURUMA/sample/listcap.c:

listcap.c:39:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); listcap.c:71:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r);

ONIGURUMA/sample/names.c:

names.c:42:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); names.c:64:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r);

ONIGURUMA/sample/simple.c:

simple.c:23:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); simple.c:47:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r);

ONIGURUMA/sample/sql.c:

sql.c:40:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); sql.c:64:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r);

ONIGURUMA/sample/syntax.c:

syntax.c:23:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); syntax.c:47:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r);

ONIGURUMA/sample/crnl.c:

crnl.c:47:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r, &einfo); crnl.c:66:28: warning: passing 'char [90]' to parameter of type 'OnigUChar ' (aka 'unsigned char ') converts between pointers to integer types with different sign [-Wpointer-sign] onig_error_code_to_str(s, r);

vnmakarov commented 8 years ago

Thanks for the warnings. I know about them although I use an older version of Mac OSX. May be the current version of ONIGURUMA will have no warnings. I'll check it.

vnmakarov commented 8 years ago

With new version (6.0..0) of ONIGURUMA, the warnings are gone. Still there are warnings implicit declaration of function ‘onig_initialize’ which I guess is ok. In any case the directory sample contains a code which is never used in DINO.