From rodrigc@attbi.com  Sat Oct  5 10:39:29 2002
Return-Path: <rodrigc@attbi.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP
	id 8CF9737B401; Sat,  5 Oct 2002 10:39:29 -0700 (PDT)
Received: from dibbler.ne.client2.attbi.com (dibbler.ne.client2.attbi.com [24.61.41.247])
	by mx1.FreeBSD.org (Postfix) with ESMTP
	id 0D01543E3B; Sat,  5 Oct 2002 10:39:29 -0700 (PDT)
	(envelope-from rodrigc@attbi.com)
Received: from dibbler.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])
	by dibbler.ne.client2.attbi.com (8.12.6/8.12.5) with ESMTP id g95He38A060071;
	Sat, 5 Oct 2002 13:40:03 -0400 (EDT)
	(envelope-from rodrigc@dibbler.ne.client2.attbi.com)
Received: (from rodrigc@localhost)
	by dibbler.ne.client2.attbi.com (8.12.6/8.12.6/Submit) id g95He3OD060070;
	Sat, 5 Oct 2002 13:40:03 -0400 (EDT)
Message-Id: <200210051740.g95He3OD060070@dibbler.ne.client2.attbi.com>
Date: Sat, 5 Oct 2002 13:40:03 -0400 (EDT)
From: Craig Rodrigues <rodrigc@attbi.com>
Reply-To: Craig Rodrigues <rodrigc@attbi.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: eivind@freebsd.org, rodrigc@attbi.com
Subject: devel/re2c fixes for GCC 3.2
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         43720
>Category:       ports
>Synopsis:       devel/re2c fixes for GCC 3.2
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    eivind
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 05 10:40:11 PDT 2002
>Closed-Date:    Thu Nov 28 11:31:08 PST 2002
>Last-Modified:  Thu Nov 28 11:31:08 PST 2002
>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:
Responsible-Changed-From-To: freebsd-ports->eivind 
Responsible-Changed-By: naddy 
Responsible-Changed-When: Sat Oct 5 12:05:02 PDT 2002 
Responsible-Changed-Why:  
over to maintainer 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43720 
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Thu Nov 28 11:30:51 PST 2002 
State-Changed-Why:  
Committed, thanks 

http://www.freebsd.org/cgi/query-pr.cgi?pr=43720 
>Unformatted:
