linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dtc: supply a definition for YYRHSLOC if there isn't one
@ 2008-07-16 17:53 Paul Gortmaker
  2008-07-17  5:47 ` David Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Gortmaker @ 2008-07-16 17:53 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Gortmaker, jdl, david

It seems that some machines, like a default RHEL4 install, will
not have a definition for YYRHSLOC, and that prevents building
dtc.  This supplies what appears to be the standard definition
for it in the event that the host system does not have it defined.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
 srcpos.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/srcpos.h b/srcpos.h
index e17c7c0..fa4d001 100644
--- a/srcpos.h
+++ b/srcpos.h
@@ -39,6 +39,10 @@ typedef struct YYLTYPE {
     struct dtc_file *file;
 } YYLTYPE;
 
+#if ! defined(YYRHSLOC)
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#endif
+
 #define YYLTYPE_IS_DECLARED	1
 #define YYLTYPE_IS_TRIVIAL	1
 #endif
-- 
1.5.6.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] dtc: supply a definition for YYRHSLOC if there isn't one
  2008-07-16 17:53 [PATCH] dtc: supply a definition for YYRHSLOC if there isn't one Paul Gortmaker
@ 2008-07-17  5:47 ` David Gibson
  2008-07-17 14:02   ` Paul Gortmaker
  0 siblings, 1 reply; 3+ messages in thread
From: David Gibson @ 2008-07-17  5:47 UTC (permalink / raw)
  To: Paul Gortmaker; +Cc: linuxppc-dev, jdl

On Wed, Jul 16, 2008 at 01:53:57PM -0400, Paul Gortmaker wrote:
> It seems that some machines, like a default RHEL4 install, will
> not have a definition for YYRHSLOC, and that prevents building
> dtc.  This supplies what appears to be the standard definition
> for it in the event that the host system does not have it defined.

I'm pretty uneasy about this, since it relies on knowing the internals
of how bison manages its tokens.  What version of bison is it in RHEL4
that causes the trouble?

In fact I have a feeling that the extra 'file' field in YYLTYPE never
gets used, which means we could just ditch our custom YYLLOC_DEFAULT
definition, which would be a better idea, IMO, except that we'll
probably want the file info back at some point.

Ick.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] dtc: supply a definition for YYRHSLOC if there isn't one
  2008-07-17  5:47 ` David Gibson
@ 2008-07-17 14:02   ` Paul Gortmaker
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Gortmaker @ 2008-07-17 14:02 UTC (permalink / raw)
  To: Paul Gortmaker, linuxppc-dev, jdl

David Gibson wrote:
> On Wed, Jul 16, 2008 at 01:53:57PM -0400, Paul Gortmaker wrote:
>   
>> It seems that some machines, like a default RHEL4 install, will
>> not have a definition for YYRHSLOC, and that prevents building
>> dtc.  This supplies what appears to be the standard definition
>> for it in the event that the host system does not have it defined.
>>     
>
> I'm pretty uneasy about this, since it relies on knowing the internals
> of how bison manages its tokens.  What version of bison is it in RHEL4
> that causes the trouble?
>   

Right -- well, I trust your judgment on something like that more than
my own.   The version in question is "bison (GNU Bison) 1.875c".

When I was digging around, the definitions all pretty much came back
with the one I'd used, but I do understand your concern.

> In fact I have a feeling that the extra 'file' field in YYLTYPE never
> gets used, which means we could just ditch our custom YYLLOC_DEFAULT
> definition, which would be a better idea, IMO, except that we'll
> probably want the file info back at some point.
>
> Ick.
>   

Sorry to be the bearer of bad news   :-)   If you have an alternate fix that
you'd like me to test, I'd be happy to do so;  I've still access to the old
machine on which the problem report was 1st bounced to me from.  If I
tried to fix it in any other way than what I did, I'd probably hurt 
myself...

Paul.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-17 13:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 17:53 [PATCH] dtc: supply a definition for YYRHSLOC if there isn't one Paul Gortmaker
2008-07-17  5:47 ` David Gibson
2008-07-17 14:02   ` Paul Gortmaker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).