summaryrefslogtreecommitdiff
path: root/tests/nonnull.c
blob: fb8efdd0e2c96515476e6985d6b97c5ba4c68719 (plain)
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
/* Template: generic */

/*
 * No error
 */
{
	guint64 size = g_ascii_strtoull ("some-constant-string", NULL, 10);
}

/*
 * No error
 */
{
	const gchar *some_str = "foo";
	guint64 size = g_ascii_strtoull (some_str, NULL, 10);
}

/*
 * No error
 */
{
	const gchar *endptr = NULL;
	guint64 size = g_ascii_strtoull ("some-constant-string", (gchar **) &endptr, 10);
}

/*
 * null passed to a callee that requires a non-null argument
 *         guint64 size = g_ascii_strtoull (NULL, NULL, 10);
 *                                          ~~~~          ^
 */
{
	guint64 size = g_ascii_strtoull (NULL, NULL, 10);
}