xavierleroy / camlidl

Stub code generator for OCaml/C interface
Other
34 stars 8 forks source link

Typo in comintf.c #5

Closed xavierleroy closed 5 years ago

xavierleroy commented 6 years ago

As reported privately to me:

 comintf.c:168:33: warning: logical 'or' of equal expressions [-Wlogical-op]

Source code is

if (! is_a_caml_interface(i1) || ! is_a_caml_interface(i2))

but

#define is_a_caml_interface(i) \
  ((void *) (((interface IUnknown *) i1)->lpVtbl->QueryInterface) == \
   (void *) camlidl_QueryInterface)

Note how the macro has an unused parameter i, but uses i1. Looks wrong to me. Suggest rework.