Skip to content

Commit 6d55755

Browse files
aldotgeky
authored andcommitted
tests: Silence warnings in template
- no previous prototype for ‘test_assert’ - no previous prototype for ‘test_count’ - unused parameter ‘b’ in test_count - function declaration isn’t a prototype for main
1 parent 029361e commit 6d55755

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/template.fmt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88

99
// test stuff
10-
void test_log(const char *s, uintmax_t v) {{
10+
static void test_log(const char *s, uintmax_t v) {{
1111
printf("%s: %jd\n", s, v);
1212
}}
1313

14-
void test_assert(const char *file, unsigned line,
14+
static void test_assert(const char *file, unsigned line,
1515
const char *s, uintmax_t v, uintmax_t e) {{
1616
static const char *last[6] = {{0, 0}};
1717
if (v != e || !(last[0] == s || last[1] == s ||
@@ -37,7 +37,8 @@ void test_assert(const char *file, unsigned line,
3737

3838

3939
// utility functions for traversals
40-
int test_count(void *p, lfs_block_t b) {{
40+
static int __attribute__((used)) test_count(void *p,
41+
lfs_block_t b __attribute__((unused))) {{
4142
unsigned *u = (unsigned*)p;
4243
*u += 1;
4344
return 0;
@@ -96,7 +97,7 @@ const struct lfs_config cfg = {{
9697

9798

9899
// Entry point
99-
int main() {{
100+
int main(void) {{
100101
lfs_emubd_create(&cfg, "blocks");
101102

102103
{tests}

0 commit comments

Comments
 (0)