diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-10-13 14:01:04 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-10-13 14:01:04 +0000 |
commit | 07a04961491c21f839f0fe2490693e8174eb1ae6 (patch) | |
tree | 54d851db86d2bedbb9424694b2facd50a6faf743 /usr.bin | |
parent | 268320b2c7afd86c978bd2b6748cea92c384cca8 (diff) |
Do not warn about declarations of functions returning function pointers,
getting rid of a false positive noticed by bentley@.
Diffstat (limited to 'usr.bin')
-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); |