File: ullint.c

package info (click to toggle)
splint 1%3A3.1.2%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid, trixie
  • size: 21,004 kB
  • sloc: ansic: 150,869; yacc: 3,465; sh: 3,034; makefile: 2,157; lex: 412
file content (42 lines) | stat: -rw-r--r-- 824 bytes parent folder | download | duplicates (7)
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
/*
** This test provided by Jim Zelenka
*/

typedef unsigned long       pan_uint32_t;
typedef long long           pan_int64_t;
typedef unsigned long long  pan_uint64_t;

struct t_s {
  pan_uint32_t  w;
  pan_uint32_t  x;
};

int
main (/*@unused@*/ int argc,
      /*@unused@*/ char **argv)
{
  unsigned char c, *src, _src[6];
  pan_uint32_t d, ui32;
  pan_uint64_t e;
  struct t_s st2;
  int i;

  c = 0x01; /* Error without +charintliteral or +charint */

  st2.w = 1;
  st2.x = 2;

  for(i=0;i<sizeof(src);i++) { /* Error for i < sizeof */
    _src[i] = (unsigned char)i;
  }

  src = _src;

  ui32 = (pan_uint32_t)((src[0] ^ 0xFC) << 30) | ((src[1] ^ 0x80) << 24) | ((src[2] ^ 0x80) << 18) | ((src[3] ^ 0x80) << 12) | ((src[4] ^ 0x80) << 6) | (src[5] ^ 0x80);

  d = c;

  e = st2.w + (st2.x * 1000000000);

  exit(0);
}