Re: [Module-build-general] "0" options in compilation lines?
Status: Beta
Brought to you by:
kwilliams
|
From: Randy W. S. <Ra...@Th...> - 2003-02-26 00:56:41
|
On 2/24/2003 1:04 PM, Ken Williams wrote:
> Hi Randy,
>
> I noticed this line in the format_compiler_cmd() code from your patch:
>
> return [ grep {defined && $_} (
> $spec{cc}, '-c' ,
> @{$spec{includes}} ,
> @{$spec{cflags}} ,
> @{$spec{optimize}} ,
> @{$spec{defines}} ,
> @{$spec{perlinc}} ,
> "-Fo$spec{output}" ,
> $spec{source} ,
> ) ];
>
> I was wondering about the check for boolean truth, which will turn
> argument lists like ('-foo', 0) into ('-foo'). Maybe it would be safer
> to just use grep {defined()}, or grep {defined() && length()}, or
> something? Or are there some zeroes you're specifically trying to
> filter out?
>
> -Ken
Your right. Bad habbit. I know it's bad for me, but I can't stop...
I can't think of anyway in which it might fail, but it should be changed.
Randy.
|