Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000374OCamlCamlIDLpublic2001-06-02 18:492001-07-30 09:31
Reporteradministrator 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000374: camlidl problems
DescriptionFull_Name: Dmitry Bely
Version: 3.01, camlidl 1.01
OS: Windows NT 4.0
Submission from: d204.p3.col.ru (195.210.132.204)


1. 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)

2. [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.

3. "const" is not allowed in type-spec declarators. So the following does not
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.

4. 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

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)

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0000026)
administrator (administrator)
2001-06-18 10:04

> 1. 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.

> 2. [string] attribute (and maybe others) is handled wrong for typedefs:

Fixed.

> 3. "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();

> 4. 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.

All the best,

- Xavier Leroy

(0000027)
administrator (administrator)
2001-06-21 17:00

Fixed 2001-06-18 by XL.

- Issue History
Date Modified Username Field Change
2005-11-18 10:13 administrator New Issue


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker