[cups.bugs] [MOD] STR #3210: ppdc: #if...#endif block in .drv files not processed as documented by PPD Compiler

Smith Kennedy smith.kennedy at hp.com
Wed May 27 08:40:57 PDT 2009


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

The "#if ... #endif" logic seems to not work correctly, particularly when
handling definitions that are arguments to ppdc using the -D argument. 
The documentation for the "#if" directive in a .drv file, found here:

http://cups.org/documentation.php/doc-1.4/ref-ppdcfile.html#_if

says "The #if directive allows portions of a driver information file to be
used conditionally. When followed by a name, the data that follows is used
only when the name is defined, otherwise the data is ignored. #if
directives can be nested up to 100 times."

However, in practice the data is not ignored if the name is not defined,
but generates warnings, and the results seem fairly arbitrary, or at least
don't follow the behaviors of the C preprocessor #if directives on which I
assume they are based.

I have attached a zip file with 3 different copies of a test .drv file,
which is basically the example .drv file content from this URL:

http://cups.org/documentation.php/doc-1.4/raster-driver.html

with the Version directive commented out, and replaced with several test
cases that are documented in comments.  Also included are the outputs that
are produced using the CUPS 1.4b3 DDK that is included in Mac OS X 10.6
Server (10a354).

The expected and actual results are described in the comments in the .drv
files.  I hope this format is acceptable - if not I will re-submit this
defect in a more appropriate manner.

Link: http://www.cups.org/str.php?L3210
Version: 1.4b3
Attachment: http://www.cups.org/strfiles/3210/cups-if-endif-problem.zip





More information about the cups-devel mailing list