Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Change path for win32 ucontext files.
[simgrid.git] / buildtools / Cmake / test_prog / prog_max_size.c
1 //This programme check size of datatypes 
2
3 /* Copyright (c) 2010. The SimGrid Team.
4  * All rights reserved.                                                     */
5
6 /* This program is free software; you can redistribute it and/or modify it
7  * under the terms of the license (GNU LGPL) which comes with this package. */
8
9
10 #include <sys/types.h>
11 #include <stdio.h>
12
13 int main (void)
14 {
15
16         int c = sizeof(char);
17         int si = sizeof(short int);
18         int i = sizeof(int);
19         int li = sizeof(long int);
20         int lli = sizeof(long long int);
21         int f = sizeof(float);
22         int v = sizeof(void *);
23         int vv = sizeof(void (*) (void));
24         int t[8] = {c,si,i,li,lli,f,v,vv};
25         
26         int max = t[0];
27
28         for (i = 1; i < 8; i++)
29         { 
30                 if (t[i] > max) max = t[i];
31
32         } 
33         printf("%d",max);
34         return 1;
35 }
36