File: main.c

package info (click to toggle)
cbmc 5.10-5
  • links: PTS
  • area: main
  • in suites: buster
  • size: 73,416 kB
  • sloc: cpp: 264,330; ansic: 38,268; java: 19,025; python: 4,539; yacc: 4,275; makefile: 2,547; lex: 2,394; sh: 932; perl: 525; xml: 289; pascal: 169
file content (48 lines) | stat: -rw-r--r-- 875 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#define STATIC_ASSERT(condition) \
  int some_array##__LINE__[(condition) ? 1 : -1]

#ifdef _WIN32
typedef unsigned __int64 uint64_t;
typedef unsigned int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
#define __extension__
#else
#include <inttypes.h>
#endif

#pragma pack(1)
typedef union RTFLOAT80U
{
    __extension__ struct
    {
        uint64_t u64Mantissa;
        __extension__ uint16_t uExponent : 15;
        __extension__ uint16_t fSign : 1;
    } s;

    uint64_t au64[1];
    uint32_t au32[2];
    uint16_t au16[5];
    uint8_t au8[10];
} RTFLOAT80U;
#pragma pack()

STATIC_ASSERT(sizeof(RTFLOAT80U)==10);

struct S
{
  char c;
  int i;
};

STATIC_ASSERT(sizeof(struct S)==2*sizeof(int));

#include <stdio.h>

int main()
{
  printf("RTFLOAT80U: %lu\n", sizeof(RTFLOAT80U));
  printf("struct S: %lu\n", sizeof(struct S));
  return 0;
}