Bug 3413

Summary: [PATCH] predefined cpp macros can produce unexpected resuls in xrdb
Product: xorg Reporter: Matthieu Herrb <matthieu.herrb>
Component: App/xrdbAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: erik.andren
Version: gitKeywords: patch
Hardware: x86 (IA32)   
OS: OpenBSD   
Whiteboard: 2011BRB_Reviewed
i915 platform: i915 features:
Attachments:
Description Flags
proposed patch none

Description Matthieu Herrb 2005-05-27 14:08:43 UTC
GNU cpp is predefining a number of symbols, depending on the host and target
architecture. This can produce some unexpected results: for example, the
expansion of CLIENTHOST if the host name is i386.my.domain.

The attached patch creates a new -undef option to xrdb that is passed to cpp.
Should it be on by default ?
Comment 1 Matthieu Herrb 2005-05-27 14:09:14 UTC
Created attachment 2781 [details] [review]
proposed patch
Comment 2 Erik Andren 2006-04-18 05:08:32 UTC
added patch keyword
Comment 3 Daniel Stone 2007-02-27 01:26:51 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 4 Matt Turner 2010-12-03 12:52:45 UTC
I sent this patch to xorg-devel for discussion/review. This bug report is obviously not doing much, so I'm going to close it.
Comment 5 Jeremy Huddleston Sequoia 2011-10-03 20:42:59 UTC
Hey Matt, where did this go?  The patch looks fine to me:

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>

I think we should leave it off by default as someone might actually be doing 
something like #ifdef __i386__ in their .Xresources.
Comment 6 Matthieu Herrb 2011-10-03 23:43:51 UTC
(In reply to comment #5)
> Hey Matt, where did this go?  The patch looks fine to me:
> 
> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
> 
> I think we should leave it off by default as someone might actually be doing 
> something like #ifdef __i386__ in their .Xresources.

Yes this is the kind of reasons that made this patch stall. I'll revisit the issue and push the fix disabled. Thanks for reviewing it.
Comment 7 Matt Turner 2011-10-04 07:06:37 UTC
(In reply to comment #5)
> Hey Matt, where did this go?  The patch looks fine to me:
> 
> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
> 
> I think we should leave it off by default as someone might actually be doing 
> something like #ifdef __i386__ in their .Xresources.

I sent it off: http://lists.x.org/archives/xorg-devel/2010-December/thread.html#16525

but there were corner cases that made people wary of committing it.
Comment 8 Alan Coopersmith 2013-07-20 02:03:19 UTC
I pushed the version that leaves the default the same as current, but lets
you specify -undef to pass the -undef flag to cpp.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.