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: 374 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Full_Name: Dmitry Bely
Version: 3.01, camlidl 1.01
OS: Windows NT 4.0
Submission from: d204.p3.col.ru (195.210.132.204)
For compatibility with Microsoft IDL (and maybe other IDL compilers) it would
be nice to emit '\n' into the target file after each cpp_quote/quote statement.
It will let the following construct work correctly:
cpp_quote("#define FAR _far")
cpp_quote("#define PASCAL _pascal")
cpp_quote("#define CDECL _cdecl")
(currently all these #define statements are merged into one line)
[string] attribute (and maybe others) is handled wrong for typedefs:
typedef [string] char* PCHAR1; /* OK */
but
typedef char CHAR;
typedef [string] CHAR* PCHAR2; /* Warning: attribute `string' unknown, malformed
or not applicable here, ignored. */
midl handles this correctly and intensively use such constructs in its .idl
files.
"const" is not allowed in type-spec declarators. So the following does not
pass camlidl:
Yes, this behaviour conforms to Camlidl manual, but midl intensively use this
feature, and it seems to be natural for IDL language.
In case of syntax error Camlidl sometimes points at the wrong place
(sometimes far away from the real place if .idl file is big enough). Here is an
example:
--- test.idl
// line 0, pos 0
typedef unsigned short WORD;
typedef unsigned int UINT;
typedef int INT;
typedef long BOOL;
typedef long LONG;
typedef UINT WPARAM;
typedef unsigned long DWORD;
typedef LONG LPARAM;
typedef LONG LRESULT;
typedef void * HANDLE;
typedef HANDLE HDWP;
#define DECLARE_HANDLE(name) typedef void * name
For compatibility with Microsoft IDL (and maybe other IDL
compilers) it would be nice to emit '\n' into the target file after
each cpp_quote/quote statement.
Good point. Done.
[string] attribute (and maybe others) is handled wrong for typedefs:
Fixed.
"const" is not allowed in type-spec declarators. So the following does not
pass camlidl:
It seems that "const" in types was only recently added to the COM IDL
specification. I patched CamlIDL to support it, although it's a bit
of a hack; in particular there is a weird parsing ambiguity between
const int x = 1 /* a constant declaration /
and
const int f(); / a function declaration */
but this isn't too bad since the latter can also be written
int const f();
In case of syntax error Camlidl sometimes points at the wrong
place (sometimes far away from the real place if .idl file is big
enough). Here is an example:
That's a general problem with Yacc parsers: they can shift quite a lot
of text before getting stuck and reporting an error. So, I haven't
addressed this issue.
If you wish to test the working sources for CamlIDL, which should fix
all the issues you reported, you can get them using anonymous CVS from
camlcvs.inria.fr. (See http://camlcvs.inria.fr/) I'll probably make
a public release within one month.
Original bug ID: 374
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
Full_Name: Dmitry Bely
Version: 3.01, camlidl 1.01
OS: Windows NT 4.0
Submission from: d204.p3.col.ru (195.210.132.204)
be nice to emit '\n' into the target file after each cpp_quote/quote statement.
It will let the following construct work correctly:
cpp_quote("#define FAR _far")
cpp_quote("#define PASCAL _pascal")
cpp_quote("#define CDECL _cdecl")
(currently all these #define statements are merged into one line)
typedef [string] char* PCHAR1; /* OK */
but
typedef char CHAR;
typedef [string] CHAR* PCHAR2; /* Warning: attribute `string' unknown, malformed
or not applicable here, ignored. */
midl handles this correctly and intensively use such constructs in its .idl
files.
pass camlidl:
void f( const char* c ); /* syntax error */
typedef [string] const char LPCSTR; / syntax error */
Yes, this behaviour conforms to Camlidl manual, but midl intensively use this
feature, and it seems to be natural for IDL language.
(sometimes far away from the real place if .idl file is big enough). Here is an
example:
--- test.idl
// line 0, pos 0
typedef unsigned short WORD;
typedef unsigned int UINT;
typedef int INT;
typedef long BOOL;
typedef long LONG;
typedef UINT WPARAM;
typedef unsigned long DWORD;
typedef LONG LPARAM;
typedef LONG LRESULT;
typedef void * HANDLE;
typedef HANDLE HDWP;
#define DECLARE_HANDLE(name) typedef void * name
DECLARE_HANDLE(HMODULE);
DECLARE_HANDLE(HINSTANCE);
DECLARE_HANDLE(HRGN);
DECLARE_HANDLE(HTASK);
DECLARE_HANDLE(HKEY);
DECLARE_HANDLE(HDESK);
DECLARE_HANDLE(HMF);
DECLARE_HANDLE(HEMF);
DECLARE_HANDLE(HPEN);
DECLARE_HANDLE(HRSRC);
DECLARE_HANDLE(HSTR);
DECLARE_HANDLE(HWINSTA);
DECLARE_HANDLE(HKL);
DECLARE_HANDLE(HGDIOBJ);
// (_) <- line 31, pos 11
typedef [string] const char *LPSTR;
--- end of test.idl
produces
test.idl
File test.idl, line 31, character 11: syntax error
although the real position is line 32, char 17 ("const" problem, discussed
above)
The text was updated successfully, but these errors were encountered: