c2hs
c2hs copied to clipboard
{#sizeof#} returns incorrect value
I'm using this include file and the following Haskell source:
module Test where
#include "nfc-types.h"
{#sizeof nfc_iso14443a_info#}
The output of c2hs is:
-- GENERATED by C->Haskell Compiler, version 0.28.1 Switcheroo, 1 April 2016 (Haskell)
-- Edit the ORIGNAL .chs file instead!
{-# LINE 1 "test.chs" #-}
module Test where
296
{-# LINE 5 "test.chs" #-}
But when I compile the following program:
#include <stdio.h>
#include "nfc/nfc-types.h"
int main() {
printf("%lu\n", sizeof(nfc_iso14443a_info));
return 0;
}
The output is:
$ ./a.out
283
Probably a duplicate of #172, since that header uses #pragma pack.