From 6b92aed85943eeef405ab09af8f84adbb4766afc Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 13 Oct 2014 14:01:21 +0000 Subject: Do not warn about declarations of functions returning function pointers, getting rid of a false positive noticed by bentley@. --- mdoc_validate.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'mdoc_validate.c') diff --git a/mdoc_validate.c b/mdoc_validate.c index 10839980..8c6b7b99 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.251 2014/10/11 21:34:04 schwarze Exp $ */ +/* $Id: mdoc_validate.c,v 1.252 2014/10/13 14:01:21 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -1004,12 +1004,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); -- cgit v1.2.3