Welcome to mirror list, hosted at ThFree Co, Russian Federation.

size_max.c « newlib.stdlib « testsuite « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d163e27d1f01802efdd31163537fc6eeed0fd172 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <stddef.h>
#include <stdint.h>
#include <stdlib.h>

int main () {
  size_t s;

  s = SIZE_MAX;
  /* If SIZE_MAX is truncated when assigning to "s", then SIZE_MAX is
     too big.  */
  if (s != SIZE_MAX)
    abort ();
  /* If SIZE_MAX + 1 is not zero, then SIZE_MAX is not big enough.  */
  if (++s != 0)
    abort ();

  return 0;
}