FS#48377 - [xorg-xrdb] cpp preprocessing changes terminal name linux to 1

Attached to Project: Arch Linux
Opened by Michal Svoboda (pht) - Monday, 29 February 2016, 17:38 GMT
Last edited by Andreas Radke (AndyRTR) - Friday, 01 April 2016, 15:26 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Jan de Groot (JGC)
Andreas Radke (AndyRTR)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I found that recently preprocessing via cpp was enabled for xrdb.
( FS#46934 )

This causes a rather weird issues where you want to predefine terminal name for your terminal emulator to 'linux' (which we are all using - linux)
Because CPP has predefined constant (linux=1) it will substitute the terminal name to 1.
See https://bugs.archlinux.org/task/48264
As for why the predef is there, see http://stackoverflow.com/questions/19210935/why-does-the-c-preprocessor-interpret-the-word-linux-as-the-constant-1

Any idea how to escape the word linux, so it does not get expanded? Or can we revert  FS#46934 
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Friday, 01 April 2016, 15:26 GMT
Reason for closing:  Not a bug
Comment by Michal Svoboda (pht) - Sunday, 06 March 2016, 14:22 GMT
Any ideas on this?
Comment by Michal Svoboda (pht) - Sunday, 13 March 2016, 09:34 GMT
Ping?
Comment by Andreas Radke (AndyRTR) - Sunday, 13 March 2016, 10:02 GMT
The preprocessor is optional. So you can either install mcpp or gcc. But when gcc and mcpp is installed gcc is now preferred.

Even when both are installed you have the choice which one to use:

[andyrtr@laptop64 ~]$ man xrdb | grep -3 cpp

-cpp filename
This option specifies the pathname of the C preprocessor program to be used. Although xrdb was designed to use CPP, any program that acts
as a filter and accepts the -D, -I, and -U options may be used.

-nocpp This option indicates that xrdb should not run the input file through a preprocessor before loading it into properties.

I see ne need to revert to the old behavior that lead to different bugs.
Comment by Michal Svoboda (pht) - Sunday, 13 March 2016, 15:51 GMT
Thanks for the reply. Having gcc is pretty much common, so there is no good way to not have cpp. I know about the -nocpp option, but the problem is that the "default" invocation of xrdb (when you log in) does use cpp, and I don't really know where/how to change that.
Comment by Andreas Radke (AndyRTR) - Monday, 14 March 2016, 15:04 GMT
I guess you can modify your xinitrc adding --cpp /usr/bin/mcpp ...
Comment by Michal Svoboda (pht) - Monday, 14 March 2016, 17:26 GMT
Ok, but which one? I don't have a .xinitrc in my home. And I don't know where the system-wide xrdb call is happening. Could you help locate it?

I guess I could create $HOME/.xinitrc or something in /etc/X11/xinit/xinitrc.d/ to *override* the resources already loaded with cpp, but that really sounds like a terrible work-around!

Loading...