Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Oct 2002 13:40:03 -0400 (EDT)
From:      Craig Rodrigues <rodrigc@attbi.com>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        eivind@FreeBSD.org, rodrigc@attbi.com
Subject:   ports/43720: devel/re2c fixes for GCC 3.2
Message-ID:  <200210051740.g95He3OD060070@dibbler.ne.client2.attbi.com>

next in thread | raw e-mail | index | archive | help

>Number:         43720
>Category:       ports
>Synopsis:       devel/re2c fixes for GCC 3.2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 05 10:40:11 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Craig Rodrigues
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD dibbler.ne.client2.attbi.com 5.0-CURRENT FreeBSD 5.0-CURRENT #2: Sun Sep 8 09:39:46 EDT 2002 rodrigc@dibbler.ne.client2.attbi.com:/usr/obj/usr/src/sys/MYKERNEL1 i386


	
>Description:
    Need to change uchar to char in a few places.
    In GCC 3.2, ostream is a typedef:
    typedef basic_ostream<char>  ostream;

    Since this template can only for char, it is invalid to do something like:
    uchar foo;
    ostream.write(foo);

    Changing uchar to char does not hurt things because:
    sizeof(char) == sizeof(uchar)

    but:

    typeof(char) != typeof(uchar)

    GCC 3.2 is much more fussy about enforcing types for templates

>How-To-Repeat:
	
>Fix:

	


diff -urN re2c.orig/files/patch-aa re2c/files/patch-aa
--- re2c.orig/files/patch-aa	Wed Dec 31 19:00:00 1969
+++ re2c/files/patch-aa	Sat Oct  5 13:30:19 2002
@@ -0,0 +1,109 @@
+--- ./scanner.re.orig	Thu Aug 26 23:46:32 1999
++++ ./scanner.re	Sat Oct  5 13:27:00 2002
+@@ -10,7 +10,7 @@
+ 
+ #define	BSIZE	8192
+ 
+-#define	YYCTYPE		uchar
++#define	YYCTYPE		char
+ #define	YYCURSOR	cursor
+ #define	YYLIMIT		lim
+ #define	YYMARKER	ptr
+@@ -25,7 +25,7 @@
+     ;
+ }
+ 
+-uchar *Scanner::fill(uchar *cursor){
++char *Scanner::fill(char *cursor){
+     if(!eof){
+ 	uint cnt = tok - bot;
+ 	if(cnt){
+@@ -37,7 +37,7 @@
+ 	    lim -= cnt;
+ 	}
+ 	if((top - lim) < BSIZE){
+-	    uchar *buf = new uchar[(lim - bot) + BSIZE];
++	    char *buf = new char[(lim - bot) + BSIZE];
+ 	    memcpy(buf, tok, lim - tok);
+ 	    tok = buf;
+ 	    ptr = &buf[ptr - bot];
+@@ -68,7 +68,7 @@
+ */
+ 
+ int Scanner::echo(ostream &out){
+-    uchar *cursor = cur;
++    char *cursor = cur;
+     tok = cursor;
+ echo:
+ /*!re2c
+@@ -85,7 +85,7 @@
+ 
+ 
+ int Scanner::scan(){
+-    uchar *cursor = cur;
++    char *cursor = cur;
+     uint depth;
+ 
+ scan:
+--- ./scanner.cc.orig	Thu Aug 26 23:46:32 1999
++++ ./scanner.cc	Sat Oct  5 13:27:00 2002
+@@ -12,7 +12,7 @@
+ 
+ #define	BSIZE	8192
+ 
+-#define	YYCTYPE		uchar
++#define	YYCTYPE		char
+ #define	YYCURSOR	cursor
+ #define	YYLIMIT		lim
+ #define	YYMARKER	ptr
+@@ -27,7 +27,7 @@
+     ;
+ }
+ 
+-uchar *Scanner::fill(uchar *cursor){
++char *Scanner::fill(char *cursor){
+     if(!eof){
+ 	uint cnt = tok - bot;
+ 	if(cnt){
+@@ -39,7 +39,7 @@
+ 	    lim -= cnt;
+ 	}
+ 	if((top - lim) < BSIZE){
+-	    uchar *buf = new uchar[(lim - bot) + BSIZE];
++	    char *buf = new char[(lim - bot) + BSIZE];
+ 	    memcpy(buf, tok, lim - tok);
+ 	    tok = buf;
+ 	    ptr = &buf[ptr - bot];
+@@ -62,7 +62,7 @@
+ 
+ 
+ int Scanner::echo(ostream &out){
+-    uchar *cursor = cur;
++    char *cursor = cur;
+     tok = cursor;
+ echo:
+ {
+@@ -117,7 +117,7 @@
+ 
+ 
+ int Scanner::scan(){
+-    uchar *cursor = cur;
++    char *cursor = cur;
+     uint depth;
+ 
+ scan:
+--- ./scanner.h.orig	Thu Aug 26 23:46:32 1999
++++ ./scanner.h	Sat Oct  5 13:27:00 2002
+@@ -6,10 +6,10 @@
+ class Scanner {
+   private:
+     int			in;
+-    uchar		*bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
++    char		*bot, *tok, *ptr, *cur, *pos, *lim, *top, *eof;
+     uint		tchar, tline, cline;
+   private:
+-    uchar *fill(uchar*);
++    char *fill(char*);
+   public:
+     Scanner(int);
+     int echo(ostream&);
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210051740.g95He3OD060070>