develooper Front page | perl.perl5.porters | Postings from September 2012

Where should YYDEBUG be defined? (Re: [perl.git] branch blead,updated. v5.17.4-66-gb3045d9)

Thread Previous
From:
Craig A. Berry
Date:
September 30, 2012 14:32
Subject:
Where should YYDEBUG be defined? (Re: [perl.git] branch blead,updated. v5.17.4-66-gb3045d9)
Message ID:
craigberry-E9C729.16313730092012@cpc2-bmly6-0-0-cust974.2-3.cable.virginmedia.com
In article <E1TGfzq-00070b-7F@camel.ams6.corp.booking.com>,
 sprout@cpan.org ("Father Chrysostomos") wrote:

> In perl.git, the branch blead has been updated
> 
> <http://perl5.git.perl.org/perl.git/commitdiff/b3045d9c1f82f3a16ffa240a2b4e501
> 855d2f95e?hp=736be88fdd627ea774a29942bde021e39c4e7d8e>
> 
> - Log -----------------------------------------------------------------
> commit b3045d9c1f82f3a16ffa240a2b4e501855d2f95e
> Author: Father Chrysostomos <sprout@cpan.org>
> Date:   Tue Sep 25 18:00:42 2012 -0700
> 
>     Restore perly.o build with -DDEBUGGING
> -----------------------------------------------------------------------
> 
> Summary of changes:
>  perly.c |   13 +++++++++----
>  1 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/perly.c b/perly.c
> index c83a932..0f1b7a8 100644
> --- a/perly.c
> +++ b/perly.c
> @@ -27,6 +27,13 @@
>  
>  #include "EXTERN.h"
>  #define PERL_IN_PERLY_C
> +
> +#ifdef DEBUGGING
> +#  define YYDEBUG 1
> +#else
> +#  define YYDEBUG 0
> +#endif
> +
>  #include "perl.h"
>  
>  typedef unsigned char yytype_uint8;
> @@ -38,10 +45,8 @@ typedef signed char yysigned_char;
>  /* YYINITDEPTH -- initial size of the parser's stacks.  */
>  #define YYINITDEPTH 200
>  
> -#ifdef DEBUGGING
> -#  define YYDEBUG 1
> -#else
> -#  define YYDEBUG 0
> +#ifndef YY_NULL
> +# define YY_NULL 0
>  #endif
>  
>  /* contains all the parser state tables; auto-generated from perly.y */

This breaks the DEBUGGING build on VMS because DEBUGGING gets defined in 
config.h (not on the compiler command line) and config.h comes in via 
perl.h.  I gather the reason for moving the definition above the 
inclusion of perl.h was to make it be in effect when we hit this new 
code in perly.h:

/* Enabling traces.  */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif

That came in via 1795f87385d4c3168e.  I guess that code must come 
directly from bison as I can't find any origin for it in the Perl 
sources.  It seems wrong for our purposes since yydebug is not in fact 
an extern int but instead is:

#  define yydebug (DEBUG_p_TEST)

which expands to:

#  define DEBUG_p_TEST DEBUG_p_TEST_

which expands to:

#  define DEBUG_p_TEST_ (PL_debug & DEBUG_p_FLAG)

I think the solution would be to persuade bison to not spew its YYDEBUG 
business into perly.h and then restore the definition in perly.c to its 
original location.  But I know nothing about bison.

Thread Previous


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