Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005570OCamlCamlIDLpublic2012-04-02 01:162012-04-03 16:13
Reporterjjb 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionsuspended 
Platformx86_64OSWindowsOS Version7
Product Version 
Target VersionFixed in Version 
Summary0005570: CamlIDL does not accept 'unsigned' as an alias of 'unsigned int'
DescriptionI 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
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0007272)
xleroy (administrator)
2012-04-03 16:13

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.

- Issue History
Date Modified Username Field Change
2012-04-02 01:16 jjb New Issue
2012-04-03 16:13 xleroy Note Added: 0007272
2012-04-03 16:13 xleroy Status new => closed
2012-04-03 16:13 xleroy Resolution open => suspended


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker