From 6801c670136253eea1463e850c17fe56e89467a6 Mon Sep 17 00:00:00 2001 From: Thien-Thi Nguyen Date: Fri, 25 Jun 2010 11:27:23 +0200 Subject: [PATCH 4/8] =?utf-8?q?[maint]=20Make=20guile-func-name-check=20ignore=20a=20string=20literal=20=E2=80=98FUNC=5FNAME=E2=80=99.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit * libguile/guile-func-name-check : If the last line contains a C string literal, do nothing. --- libguile/guile-func-name-check | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/libguile/guile-func-name-check b/libguile/guile-func-name-check index f00b522..5a20275 100644 --- a/libguile/guile-func-name-check +++ b/libguile/guile-func-name-check @@ -38,10 +38,12 @@ BEGIN { # Check that for "SCM_DEFINE (foo, ...)", we see: # #define FUNC_NAME s_foo # { -# FIXME: This loses for C string-literal (#define FUNC_NAME "foo"). # FIXME: This loses if #define is inside the curly brace. /^\{/ && in_a_func { - if (!match (last_line, /^#define[ \t]+FUNC_NAME[ \t]+/)) { + if (match (last_line, /".+"/)) + # Do nothing for C string-literal (#define FUNC_NAME "foo"). + ; + else if (!match (last_line, /^#define[ \t]+FUNC_NAME[ \t]+/)) { printf filename ":" NR ":***" > "/dev/stderr"; print "Missing or erroneous `#define FUNC_NAME s_" \ func_name "'" > "/dev/stderr"; -- 1.6.3.2