Skip to content

clang: sizeof(int16_t) != 2 #2576

@edwintorok

Description

@edwintorok
Bugzilla Link 2204
Resolution FIXED
Resolved on Mar 12, 2010 00:57
Version unspecified
OS Linux
CC @efriedma-quic

Extended Description

Compile the below testcase with clang, it aborts on Linux x86-64:

#include <stdlib.h>
#include <stdint.h>
int main()
{
if(sizeof(int16_t) != 2)
abort();
}

$ /home/edwin/llvm-svn/llvm/tools/clang/utils/ccc foo.c
foo.c
clang -emit-llvm-bc -o foo.o foo.c
llvm-ld -native -disable-internalize -o a.out foo.o
$ ./a.out
Aborted

Look at the declarations of int16_t from the headers, I think that attribute is not handled.

/home/edwin/llvm-svn/llvm/tools/clang/utils/ccc foo.c -E|grep int16_t
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef int int16_t attribute ((mode (HI)));
typedef unsigned int u_int16_t attribute ((mode (HI)));
typedef unsigned short int uint16_t;
if(sizeof(int16_t) != 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaclang:frontendLanguage frontend issues, e.g. anything involving "Sema"

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions