From tobez@lion.plab.ku.dk Fri Mar 26 09:24:17 1999
Return-Path: <tobez@lion.plab.ku.dk>
Received: from lion.plab.ku.dk (lion.plab.ku.dk [130.225.105.49])
	by hub.freebsd.org (Postfix) with ESMTP id EEB2914A23
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Mar 1999 09:24:11 -0800 (PST)
	(envelope-from tobez@lion.plab.ku.dk)
Received: (from tobez@localhost)
	by lion.plab.ku.dk (8.9.3/8.9.1) id SAA00536;
	Fri, 26 Mar 1999 18:23:15 +0100 (CET)
Message-Id: <199903261723.SAA00536@lion.plab.ku.dk>
Date: Fri, 26 Mar 1999 18:23:15 +0100 (CET)
From: Anton Berezin <tobez@plab.ku.dk>
Sender: tobez@lion.plab.ku.dk
Reply-To: Anton Berezin <tobez@plab.ku.dk>
To: FreeBSD-gnats-submit@freebsd.org
Subject: h2ph incorrectly deals with #error and #warning (FIX included)
X-Send-Pr-Version: 3.2

>Number:         10805
>Category:       bin
>Synopsis:       h2ph incorrectly deals with #error and #warning (FIX included)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Mar 26 09:30:00 PST 1999
>Closed-Date:    Sun Oct 31 20:32:10 PST 1999
>Last-Modified:  Sun Oct 31 20:32:47 PST 1999
>Originator:     Anton Berezin
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
The Protein Laboratory, University of Copenhagen
>Environment:

	Any system with perl5.005_02 shipped by default

>Description:

	perl5.005_02 has a bug in h2ph utility, which leads to
	incorrectly generated perl code if the original header file
	contains any #error or #warning preprocessor statements.

	This problem was fixed in more recent perls, but FreeBSD
	default perl installation is still affected.

>How-To-Repeat:

	Try this on a system where ioctl.ph was not manually patched
	(yes, I patched this file many times before finally deciding
	to submit this report!)

	perl -e 'require "sys/ioctl.ph";'

>Fix:

Apply this patch (relatively to /usr/src):
	
--- contrib/perl5/utils/h2ph.PL.orig	Fri Mar 26 18:04:00 1999
+++ contrib/perl5/utils/h2ph.PL	Fri Mar 26 18:05:21 1999
@@ -231,9 +231,9 @@
 	    } elsif(/^undef\s+(\w+)/) {
 		print OUT $t, "undef(&$1) if defined(&$1);\n";
 	    } elsif(/^error\s+(.*)/) {
-		print OUT $t, "die(\"$1\");\n";
+		print OUT $t, "die(\"", quotemeta($1), "\");\n";
 	    } elsif(/^warning\s+(.*)/) {
-		print OUT $t, "warn(\"$1\");\n";
+		print OUT $t, "warn(\"", quotemeta($1), "\");\n";
 	    } elsif(/^ident\s+(.*)/) {
 		print OUT $t, "# $1\n";
 	    }


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: julian 
State-Changed-When: Sun Oct 31 20:32:10 PST 1999 
State-Changed-Why:  
bug fixed in new version of perl 
>Unformatted:
