summary refs log tree commit diff stats
path: root/tinyc/tests/tests2/51_static.c
blob: d6c0917cfe3c54495fdbda1e52a069870893548d (plain) (blame)
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
#include <stdio.h>

static int fred = 1234;
static int joe;

void henry()
{
   static int fred = 4567;

   printf("%d\n", fred);
   fred++;
}

int main()
{
   printf("%d\n", fred);
   henry();
   henry();
   henry();
   henry();
   printf("%d\n", fred);
   fred = 8901;
   joe = 2345;
   printf("%d\n", fred);
   printf("%d\n", joe);

   return 0;
}

/* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/
span class="o">[ -d csources ] || echo_run git clone --depth 1 https://github.com/nim-lang/csources.git nim_csources=bin/nim_csources build_nim_csources(){ ## avoid changing dir in case of failure ( echo_run cd csources echo_run sh build.sh ) # keep $nim_csources in case needed to investigate bootstrap issues # without having to rebuild from csources echo_run cp bin/nim $nim_csources } [ -f $nim_csources ] || echo_run build_nim_csources echo_run bin/nim c koch echo_run ./koch boot -d:release echo_run ./koch tools # Compile Nimble and other tools.