develooper Front page | perl.perl5.porters | Postings from April 2007

[PATCH] x2p: getenv() prototype wrong both for C89 and C++

Thread Next
From:
Jarkko Hietaniemi
Date:
April 17, 2007 19:59
Subject:
[PATCH] x2p: getenv() prototype wrong both for C89 and C++
Message ID:
200704180258.l3I2wRIN393790@kosh.hut.fi
--- a2p.c.dist	2007-04-17 14:11:43.000000000 +0300
+++ a2p.c	2007-04-18 05:54:26.000000000 +0300
@@ -2185,7 +2185,9 @@
     register int yym, yyn, yystate;
 #if YYDEBUG
     register char *yys;
-    extern char *getenv();
+#ifndef __cplusplus
+    extern char *getenv(const char *);
+#endif
 
     if ((yys = getenv("YYDEBUG")))
     {
--- Makefile.SH.dist	2007-04-17 14:11:35.000000000 +0300
+++ Makefile.SH	2007-04-18 05:57:38.000000000 +0300
@@ -119,6 +119,10 @@
 	$(BYACC) a2p.y
 	rm -f a2p.c
 	sed -e 's/(yyn = yydefred\[yystate\])/((yyn = yydefred[yystate]))/' \
+	    -e '/^    extern char \*getenv();/ c\
+#ifndef __cpluscplus\
+    extern char *getenv(const char *);\
+#endif' \
 	    -e 's/(yys = getenv("YYDEBUG"))/((yys = getenv("YYDEBUG")))/' \
 	    -e 's/^yyerrlab://' \
 	    -e 's/^    goto yyerrlab;//' \

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About