Skip to content

Commit

Permalink
sparse: Fix some "symbol not declared" warnings
Browse files Browse the repository at this point in the history
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 <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Ramsay Jones authored and Junio C Hamano committed Apr 22, 2011
1 parent 0bcd9ae commit c514772
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions attr.c
Original file line number Diff line number Diff line change
Expand Up @@ -465,15 +465,15 @@ static void drop_attr_stack(void)
}
}

const char *git_etc_gitattributes(void)
static const char *git_etc_gitattributes(void)
{
static const char *system_wide;
if (!system_wide)
system_wide = system_path(ETC_GITATTRIBUTES);
return system_wide;
}

int git_attr_system(void)
static int git_attr_system(void)
{
return !git_env_bool("GIT_ATTR_NOSYSTEM", 0);
}
Expand Down
1 change: 1 addition & 0 deletions vcs-svn/svndump.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "line_buffer.h"
#include "string_pool.h"
#include "strbuf.h"
#include "svndump.h"

/*
* Compare start of string to literal of equal length;
Expand Down

0 comments on commit c514772

Please sign in to comment.