You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 1750 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Here is an example:
signed char get0x80()
quote(call,"_res = '\x80';");
it compiles to
external get0x80 : unit -> char
= "camlidl_signed_char_get0x80"
and
value camlidl_signed_char_get0x80(value _unit)
{
signed char _res;
value _vres;
but (int)((signed char)'\x80') == -1! There is no such char value in
Ocaml (its chars are unsigned) so we are obviously in trouble.
Even worse, many compilers (including GCC and MSVC) assume that char is
signed by default so writing "char get0x80() ..." we will have just the
same problems.
What I propose: traslate "char" IDL type to "unsigned char" C type (as MIDL
compiler does) and prohibit using "signed char" IDL type (or at least
generate a warning)
Dmitry Bely
The text was updated successfully, but these errors were encountered:
Original bug ID: 1750
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Here is an example:
signed char get0x80()
quote(call,"_res = '\x80';");
it compiles to
external get0x80 : unit -> char
= "camlidl_signed_char_get0x80"
and
value camlidl_signed_char_get0x80(value _unit)
{
signed char _res;
value _vres;
/* begin user-supplied calling sequence /
_res = '\x80';
/ end user-supplied calling sequence */
_vres = Val_int(_res);
return _vres;
}
but (int)((signed char)'\x80') == -1! There is no such char value in
Ocaml (its chars are unsigned) so we are obviously in trouble.
Even worse, many compilers (including GCC and MSVC) assume that char is
signed by default so writing "char get0x80() ..." we will have just the
same problems.
What I propose: traslate "char" IDL type to "unsigned char" C type (as MIDL
compiler does) and prohibit using "signed char" IDL type (or at least
generate a warning)
The text was updated successfully, but these errors were encountered: