bugvile, a vi-compatible text editor - Bugs: bug #24532, Problem with definitions in...

 
 

bug #24532: Problem with definitions in sql-filt.l

Submitter:  None
Submitted:  Sat 11 Oct 2008 10:16:37 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Fri 04 Sep 2009 10:14:09 PM UTC, comment #6: 

thanks - closing then

Thomas Dickey <dickey>
Group administrator
Fri 04 Sep 2009 05:07:38 PM UTC, comment #5: 

I can confirm that the problem is fixed in 9.7t on OS-X 10.5 and Ubuntu Server 8.04.

Ingmar Ellenberger <iellenberger>
Tue 19 May 2009 12:08:56 AM UTC, comment #4: 

The list of #define's corresponds to the "%x" states.
Perhaps the version of lex/flex is broken in some
way (though I'd added configure checks for some of that).

Thomas Dickey <dickey>
Group administrator
Wed 01 Apr 2009 06:31:12 PM UTC, comment #3: 

Looks like the copy-and-paste messed up.  Correct the line below with this (replace the [star] with a '*'):

@@ -33,31 +32,15 @@ static int next_line; /* state after one-line SQL[star]Plus */

Ingmar Ellenberger <iellenberger>
Wed 01 Apr 2009 06:27:05 PM UTC, comment #2: 

Had the same problem on OS-X and Ubuntu Server 8.04 on patchlevel 9.7m.  To fix, I moved a few things around and declared prototyped in filters/sql-filt.l.  Here's the patch from my Git repo:

Fixing SQL filter for compilation error
---

diff --git a/vile-9.7/filters/sql-filt.l b/vile-9.7/filters/sql-filt.l
index e4b5351..6c7989a 100644
--- a/vile-9.7/filters/sql-filt.l
+++ b/vile-9.7/filters/sql-filt.l
@@ -20,7 +20,6 @@ DefineOptFilter("sql", "d");
 #define new_state(state) saved_state = began_state; set_state(state)
 #define old_state()      set_state(saved_state);
 
-
 static char *Action_attr;
 static char *Comment_attr;
 static char *Error_attr;
@@ -33,31 +32,15 @@ static int next_line; /* state after one-line SQL*Plus */
 static int began_state;
 static int saved_state;
 
-static void
-begin_oneliner(void)
-{
-    new_state(ONE_LINE);
-    next_line = LEAD;
-    flt_bfr_begin(String_attr);
-}
+static void begin_oneliner(void);
+static void finish_oneliner(void);
+static int is_oneliner(char *name);
+static void init_filter(int before GCC_UNUSED);
+static void do_filter(FILE *inputs);
 
-static void
-finish_oneliner(void)
-{
-    flt_bfr_finish();
-    new_state(next_line);
-    next_line = LEAD;
-}
-
-static int
-is_oneliner(char *name)
-{
-    char *flags = ci_keyword_flag(name);
-    int result = 0;
-    if (flags != 0)
- result = (strchr(flags, '1') != 0);
-    return result;
-}
+#if NO_LEAKS
+static void free_filter(void);
+#endif
 
 /******************************************************************************/
 
@@ -227,6 +210,32 @@ HOSTVAR ":"{IDENT}
 %%
 
 static void
+begin_oneliner(void)
+{
+    new_state(ONE_LINE);
+    next_line = LEAD;
+    flt_bfr_begin(String_attr);
+}
+
+static void
+finish_oneliner(void)
+{
+    flt_bfr_finish();
+    new_state(next_line);
+    next_line = LEAD;
+}
+
+static int
+is_oneliner(char *name)
+{
+    char *flags = ci_keyword_flag(name);
+    int result = 0;
+    if (flags != 0)
+ result = (strchr(flags, '1') != 0);
+    return result;
+}
+
+static void
 init_filter(int before GCC_UNUSED)
 {
     (void) before;

Ingmar Ellenberger <iellenberger>
Sat 11 Oct 2008 10:32:40 PM UTC, comment #1: 

perhaps you're missing the 9.7a patch (since that seems
to be the last change I made to that file).  You "should"
be able to apply a-e patches on top of 9.7 to get 9.7e.
There's a tar of the 9.7e source in

ftp://invisible-island.net/temp/vile-9.7e.tgz

which you may find useful for comparison.

Thomas Dickey <dickey>
Group administrator
Sat 11 Oct 2008 10:16:37 PM UTC, original submission:  

I maintain (more or less by default) the vile package in Mandriva Linux. Trying to bump it to 9.7 (patch e), it fails to build due to some definition issues in sql-filt.l . First it complains that ONE_LINE is undeclared. If you fix that, it complains that LEAD is undeclared, and so on.

I 'fixed' this by just copying the entire #define block for those variables from sql-filt.c into sql-filt.l:

#define INITIAL 0
#define LEAD 1
#define BODY 2
#define MORE 3
#define COMMENT0 4
#define COMMENT 5
#define INLINE_CMT 6
#define SERVER 7
#define ONE_LINE 8

I'm not sure if it's the right fix, but it makes the compile complete, and the built vile seems to work in a quick test.

This is with gcc 4.3.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by iellenberger (Posted a comment)
  • -email is unavailable- added by dickey (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2009-09-04 dickey StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code