freevryheid / duckdb

fortran bindings to duckdb c api
MIT License
9 stars 2 forks source link

hugeint range #42

Open ludnic opened 1 year ago

ludnic commented 1 year ago

I noticed that in the C header the hugeint is defined as

typedef struct {
    uint64_t lower;
    int64_t upper;
} duckdb_hugeint;

while in fortran the lower member has to be an int64 because there isn't an unsigned integer. So I think that any handling of hugeint that requires specifying these values should not be allowed in the fortran api. or is there any workaround?

See for example this test which highlighted the problem: https://github.com/duckdb/duckdb/blob/master/test/api/capi/test_capi.cpp#L347