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: 5570 Reporter:@jberdine Status: closed (set by @xavierleroy on 2012-04-03T14:13:53Z) Resolution: suspended Priority: normal Severity: minor Platform: x86_64 OS: Windows OS Version: 7 Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
It does not seem to be straightforward to work around this when using CamlIDL to bind to an existing C library that uses these type aliases by generating .idl files from the existing .h files. CamlIDL itself rejects 'typedef unsigned int unsigned' and attempting '#define unsigned unsigned int' produces erroneous results for instances of e.g. 'unsigned long'. This seems to leave very complex sed scripts or reparsing the header files.
CamlIDL now lives its own life at http://forge.ocamlcore.org/projects/camlidl/ with its own bug tracker. It could use new developers to breathe some life into it. The issue you mention sounds like it would be easy to address by a small change to the parser.
Original bug ID: 5570
Reporter: @jberdine
Status: closed (set by @xavierleroy on 2012-04-03T14:13:53Z)
Resolution: suspended
Priority: normal
Severity: minor
Platform: x86_64
OS: Windows
OS Version: 7
Category: -for CamlIDL use https://github.com/xavierleroy/camlidl/issues
Bug description
I am unsure whether it is guaranteed by the C standard, but 'unsigned' is sometimes used as an alias for 'unsigned int'. See for instance http://msdn.microsoft.com/en-us/library/a86zba5c.aspx.
It does not seem to be straightforward to work around this when using CamlIDL to bind to an existing C library that uses these type aliases by generating .idl files from the existing .h files. CamlIDL itself rejects 'typedef unsigned int unsigned' and attempting '#define unsigned unsigned int' produces erroneous results for instances of e.g. 'unsigned long'. This seems to leave very complex sed scripts or reparsing the header files.
Steps to reproduce
$ cat foo.h
void f(unsigned);
$ cat foo.c
#include "foo.h"
void main(void) {
unsigned x = 0;
f(x);
}
void f(unsigned x) {
}
$ cl /nologo foo.c
foo.c
$ camlidl foo.h
foo.h
File foo.h, line 1, column 15: syntax error
The text was updated successfully, but these errors were encountered: