diff options
| author | John Levon <john.levon@joyent.com> | 2019-11-12 16:13:58 +0000 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-11-12 21:51:31 +0100 |
| commit | fd3528aa0409874386610ce63bb647fff8312fd9 (patch) | |
| tree | 8f704874f4cbc634a9359f3fbf047f4eb907c9ee /parse.c | |
| parent | cb75739a5e07b0f435b9e2685033e1ba9ebc31cf (diff) | |
| download | sparse-dev-fd3528aa0409874386610ce63bb647fff8312fd9.tar.gz | |
Add -Wexternal-function-has-definition
Some older codebases hit this warning all the time, so it's useful
to be able to disable it.
Signed-off-by: John Levon <john.levon@joyent.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'parse.c')
| -rw-r--r-- | parse.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -2769,8 +2769,8 @@ static struct token *parse_function_body(struct token *token, struct symbol *dec function_computed_target_list = NULL; function_computed_goto_list = NULL; - if (decl->ctype.modifiers & MOD_EXTERN) { - if (!(decl->ctype.modifiers & MOD_INLINE)) + if ((decl->ctype.modifiers & (MOD_EXTERN|MOD_INLINE)) == MOD_EXTERN) { + if (Wexternal_function_has_definition) warning(decl->pos, "function '%s' with external linkage has definition", show_ident(decl->ident)); } if (!(decl->ctype.modifiers & MOD_STATIC)) |
