unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Make guile-func-name-check ignore a string literal ‘FUNC_NAME’.
@ 2010-06-25 12:20 Thien-Thi Nguyen
  2010-06-28 13:46 ` Andy Wingo
  0 siblings, 1 reply; 2+ messages in thread
From: Thien-Thi Nguyen @ 2010-06-25 12:20 UTC (permalink / raw)
  To: guile-devel

[-- Attachment #1: Type: text/plain, Size: 89 bytes --]

This silences the warning for memoize.c.

thi

_________________________________________

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0004-maint-Make-guile-func-name-check-ignore-a-string-lit.patch --]
[-- Type: text/x-diff, Size: 1460 bytes --]

From 6801c670136253eea1463e850c17fe56e89467a6 Mon Sep 17 00:00:00 2001
From: Thien-Thi Nguyen <ttn@gnuvola.org>
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 <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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-06-28 13:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-06-25 12:20 [PATCH] Make guile-func-name-check ignore a string literal ‘FUNC_NAME’ Thien-Thi Nguyen
2010-06-28 13:46 ` Andy Wingo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).