{"id":28561538,"url":"https://github.com/elaforge/c-storable","last_synced_at":"2025-06-10T11:14:42.572Z","repository":{"id":62435668,"uuid":"124188829","full_name":"elaforge/c-storable","owner":"elaforge","description":"Replacement for Storable class that omits non-C types","archived":false,"fork":false,"pushed_at":"2020-07-19T21:57:44.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-04T06:35:14.821Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elaforge.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-07T06:18:15.000Z","updated_at":"2020-07-19T21:57:46.000Z","dependencies_parsed_at":"2022-11-01T21:16:52.603Z","dependency_job_id":null,"html_url":"https://github.com/elaforge/c-storable","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaforge%2Fc-storable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaforge%2Fc-storable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaforge%2Fc-storable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaforge%2Fc-storable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elaforge","download_url":"https://codeload.github.com/elaforge/c-storable/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elaforge%2Fc-storable/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258828282,"owners_count":22763941,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-10T11:14:41.445Z","updated_at":"2025-06-10T11:14:42.560Z","avatar_url":"https://github.com/elaforge.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"When binding to C via hsc2hs, you are expected to write your own Storable\ninstances, and manually poke struct fields with any Storable type.  Since all\nmanner of non-C types are in Storable, it's easy to accidentally poke a Char\ninstead of CChar, at which point you have memory corruption that may be very\ndifficult to track down.\n\nOne such bug was enough for me, so I created a parallel CStorable class that\nprevents that kind of bug by only including C types.\n\nIf you are writing a new C binding, I recommend something higher-level than\nhsc2hs, such as c2hs, which I think should sidestep the problem entirely by\nverifying your types.  But if you are already using hsc2hs and for whatever\nreason don't want subtle memory corruption bugs, you can import ForeignC\ninstead of Foreign and Foreign.C, and see if you have any.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felaforge%2Fc-storable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felaforge%2Fc-storable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felaforge%2Fc-storable/lists"}