DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: R T

⟦69f2eab1d⟧ TextFile

    Length: 2688 (0xa80)
    Types: TextFile
    Names: »README.sunos4«

Derivation

└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
    └─⟦8185d185c⟧ »./grep-1.5.tar.Z« 
        └─⟦7013115ca⟧ 
            └─⟦this⟧ »grep-1.5/README.sunos4« 
└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89
    └─⟦f7bc72012⟧ »./grep-1.4.tar.Z« 
        └─⟦a84cb5e66⟧ 
            └─⟦this⟧ »grep-1.4/README.sunos4« 

TextFile

[ N.B. This bug strikes on a Sun 3 running SunOS 4 with the cc -O4 option
  as well as on the sparc.  -Mike ]

Date:    Fri, 24 Feb 89 15:36:40 -0600
To:      mike@wheaties.ai.mit.edu
From:    Dave Cohrs <dave@cs.wisc.edu>
Subject: bug + fix in gnu grep 1.2 (from prep.ai.mit.edu)

I tried installing the GNU grep 1.2 on a Sun4 running 4.0.1 and
"Spencer test #36" failed.  After some experimenting, I found and
fixed the bug.  Well, actually, the bug in the the C compiler, but
I managed a workaround.

Description:

The Sun4 4.0.1 C compiler with -O doesn't generate the correct for
statements of the form
	if("string")
		x;
	else
		y;
To be exact, "y;" gets executed, while "x;" should.  This causes the
#define FETCH() to fail for test #36.

Fix:

In an #ifdef sparc in dfa.c, I made two versions of FETCH, FETCH0() and
the regular FETCH().  The former takes only one argument, the latter
expects its 2nd argument to contain a non-nil string.  This removes
the need to test the constant strings, and the compiler bug isn't
exercised.  I then changed the one instance of FETCH() with a nil
second argument to be FETCH0() instead.

dave cohrs

===================================================================
RCS file: RCS/dfa.c,v
retrieving revision 1.1
diff -c -r1.1 dfa.c
*** /tmp/,RCSt1a05930	Fri Feb 24 15:32:33 1989
--- dfa.c	Fri Feb 24 15:23:34 1989
***************
*** 285,293 ****
--- 285,315 ----
  				   is turned off). */
  
  /* Note that characters become unsigned here. */
+ #ifdef sparc
+ /*
+  * Sun4 4.0.1 C compiler can't compare constant strings correctly.
+  * e.g. if("test") { x; } else { y; }
+  * the compiler will not generate code to execute { x; }, but
+  * executes { y; } instead.
+  */
+ #define FETCH0(c)   		      \
+   {			   	      \
+     if (! lexleft)	   	      \
+       return _END;	   	      \
+     (c) = (unsigned char) *lexptr++;  \
+     --lexleft;		   	      \
+   }
  #define FETCH(c, eoferr)   	      \
    {			   	      \
      if (! lexleft)	   	      \
+       regerror(eoferr);  	      \
+     (c) = (unsigned char) *lexptr++;  \
+     --lexleft;		   	      \
+   }
+ #else
+ #define FETCH(c, eoferr)   	      \
+   {			   	      \
+     if (! lexleft)	   	      \
        if (eoferr)	   	      \
  	regerror(eoferr);  	      \
        else		   	      \
***************
*** 295,300 ****
--- 317,323 ----
      (c) = (unsigned char) *lexptr++;  \
      --lexleft;		   	      \
    }
+ #endif sparc
  
  static _token
  lex()
***************
*** 303,309 ****
--- 326,336 ----
    int invert;
    _charset cset;
  
+ #ifdef sparc
+   FETCH0(c);
+ #else
    FETCH(c, (char *) 0);
+ #endif sparc
    switch (c)
      {
      case '^':