New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add c type sizes for OpenBSD #1016

wants to merge 2 commits into
base: master


None yet
2 participants

jan-schreib commented May 16, 2018


#include <stdio.h>

        printf("short      : %lu\n", sizeof(short));
        printf("ushort     : %lu\n", sizeof(unsigned short));
        printf("int        : %lu\n", sizeof(int));
        printf("uint       : %lu\n", sizeof(unsigned int));
        printf("long       : %lu\n", sizeof(long));
        printf("ulong      : %lu\n", sizeof(unsigned long));
        printf("long long  : %lu\n", sizeof(long long));
        printf("ulong long : %lu\n", sizeof(unsigned long long));
        printf("size_t     : %lu\n", sizeof(size_t));

        return 0;

to figure out the sizes.

@@ -743,6 +743,22 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) {
case OsLv2:
case OsNetBSD:

This comment has been minimized.


andrewrk May 16, 2018


looks like you need to shift these down so they get the panic():

         case OsAnanas:
         case OsCloudABI:
         case OsDragonFly:
         case OsFreeBSD:
         case OsIOS:
         case OsKFreeBSD:
         case OsLv2:
         case OsNetBSD: 

This comment has been minimized.


jan-schreib May 16, 2018

Moved the targets.

@andrewrk andrewrk closed this in 967bad4 May 17, 2018

BraedonWooding added a commit to BraedonWooding/zig that referenced this pull request May 17, 2018

OpenBSD has the same C integer sizes as Linux
Thanks Jan S <> for this information

closes ziglang#1016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment