diff options
author | 2014-10-13 14:01:03 +0000 | |
---|---|---|
committer | 2014-10-13 14:01:03 +0000 | |
commit | 0ff14c7157b3fd087bc32f34b994ec63f960d020 (patch) | |
tree | 6e4e4f0fdf5469d942380685c500ba67019bc3c0 /usr.bin/mandoc/mdoc_validate.c | |
parent | Remove _XOPEN_SOURCE_EXTENDED since we're not too concerned about (diff) | |
download | wireguard-openbsd-0ff14c7157b3fd087bc32f34b994ec63f960d020.tar.xz wireguard-openbsd-0ff14c7157b3fd087bc32f34b994ec63f960d020.zip |
Do not warn about declarations of functions returning function pointers,
getting rid of a false positive noticed by bentley@.
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index d7eafd7ce42..79e479c18bc 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.168 2014/10/11 21:33:58 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.169 2014/10/13 14:01:03 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -1003,12 +1003,14 @@ post_eoln(POST_ARGS) static int post_fname(POST_ARGS) { - const struct mdoc_node *n; - size_t pos; + const struct mdoc_node *n; + const char *cp; + size_t pos; n = mdoc->last->child; pos = strcspn(n->string, "()"); - if (n->string[pos] != '\0') + cp = n->string + pos; + if ( ! (cp[0] == '\0' || (cp[0] == '(' && cp[1] == '*'))) mandoc_msg(MANDOCERR_FN_PAREN, mdoc->parse, n->line, n->pos + pos, n->string); return(1); |