File: s-data.c

package info (click to toggle)
uftrace 0.18.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,356 kB
  • sloc: ansic: 49,770; python: 11,181; asm: 837; makefile: 769; sh: 637; cpp: 627; javascript: 191
file content (24 lines) | stat: -rw-r--r-- 352 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <stdio.h>

static int static_var = 1;
int global_var = 2;
int __attribute__((weak)) weak_var = 3;

int foo(int *p, int n)
{
	*p = n;
	return n + 1;
}

int filecmp(FILE *a, FILE *b)
{
	return a == b;
}

int main(void)
{
	foo(&static_var, static_var);
	foo(&global_var, global_var);
	foo(&weak_var, weak_var);
	return filecmp(stdout, stderr);
}