Subject: Re: Option to make cpp(1) not accept named pipes or devices as include
To: Jim Wise <jwise@draga.com>
From: Andrew Brown <atatat@atatdot.net>
List: tech-toolchain
Date: 11/29/2004 23:30:23
On Mon, Nov 29, 2004 at 04:50:46PM -0500, Jim Wise wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>On Mon, 29 Nov 2004, Hubert Feyrer wrote:
>
>> On Mon, 29 Nov 2004, Jim Wise wrote:
>>> Any suggested improvements before I do so?
>>
>> Add a command line switch? It's the unix way of altering command behaviour...
>
>Eh?  From $PATH to $EDITOR to $TERM, lot's of programs alter their 
>behavior based on environment variables.

that's a silly argument.  :)

*lots* of programs use $PATH and and $EDITOR (or $VISUAL -- why are
there two?) or $TERM, but only cpp will use your CPP_RESTRICTED
variable.

>More specifically, I'm somewhat hesitant to use a flag in this case.  
>
>My main concern is that this will be most often used by programs 
>exec'ing cpp, and not all of them will be smart about allowing arguments 
>to be part of ${CPP}, so an environment variable provides a saner way to 
>modify cpp's behavior when called from an already-existing binary or 
>script.
>
>There's also the concern that if users decide to use a non-basesrc cpp 
>(as _many_ users do via pkgsrc/lang/gcc34), a new command line option 
>will cause cpp to fail outright, while a new environment variable will 
>not.
>
>That's why I chose the route I did, anyway...

that's a decent argument, but imho a flag is still a better way to do
it.

-- 
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org             * "ah!  i see you have the internet
twofsonet@graffiti.com (Andrew Brown)                that goes *ping*!"
werdna@squooshy.com       * "information is power -- share the wealth."