Skip to content

Commit c514772

Browse files
Ramsay Jonesgitster
authored andcommitted
sparse: Fix some "symbol not declared" warnings
In particular, sparse issues the "symbol 'a_symbol' was not declared. Should it be static?" warnings for the following symbols: attr.c:468:12: 'git_etc_gitattributes' attr.c:476:5: 'git_attr_system' vcs-svn/svndump.c:282:6: 'svndump_read' vcs-svn/svndump.c:417:5: 'svndump_init' vcs-svn/svndump.c:432:6: 'svndump_deinit' vcs-svn/svndump.c:445:6: 'svndump_reset' The symbols in attr.c only require file scope, so we add the static modifier to their declaration. The symbols in vcs-svn/svndump.c are external symbols, and they already have extern declarations in the "svndump.h" header file, so we simply include the header in svndump.c. Signed-off-by: Ramsay Jones <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0bcd9ae commit c514772

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

attr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,15 @@ static void drop_attr_stack(void)
465465
}
466466
}
467467

468-
const char *git_etc_gitattributes(void)
468+
static const char *git_etc_gitattributes(void)
469469
{
470470
static const char *system_wide;
471471
if (!system_wide)
472472
system_wide = system_path(ETC_GITATTRIBUTES);
473473
return system_wide;
474474
}
475475

476-
int git_attr_system(void)
476+
static int git_attr_system(void)
477477
{
478478
return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
479479
}

vcs-svn/svndump.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include "line_buffer.h"
1414
#include "string_pool.h"
1515
#include "strbuf.h"
16+
#include "svndump.h"
1617

1718
/*
1819
* Compare start of string to literal of equal length;

0 commit comments

Comments
 (0)