Re: [exim] More integer annoyances in 4.65

Top Page
Delete this message
Reply to this message
Author: Wakko Warner
Date:  
To: B. Johannessen
CC: exim-users
Subject: Re: [exim] More integer annoyances in 4.65
B. Johannessen wrote:
> Wakko Warner wrote:
> > # perl -e 'print "Its 0\n" if "" == 0'
> > Its 0
> > Case closed =)
>
> echo 'main(){if(0=="")printf("Its 0\n");}' | gcc -w -x c - && ./a.out
>
> Case re-opened :-)


Actually this is different. Why? C has a specific sense of integers. Perl
does not.

Thus in C, it's possible that ""=="" is false (because that can be 2 different
strings). Besides, the exim config and perl scripts are both interperated
=)

In perl, it converts from int to string automatically.

Thus:
# perl -we 'print "Its 0\n" if ""=="0"'
Argument "" isn't numeric in numeric eq (==) at -e line 1.
Its 0
#

This time, I'm doing an integer comparison on 2 strings, a "" and a "0".

> Seriously though, I think the best solution to this is to bring back the
> previous behavior. There are clearly a lot of configurations in the wild
> that depends on this (I probably have some myself), and a minor
> dot-release is not the right time for such a change. Logging a warning
> would probably also be appropriate.


I would agree with this, however the servers I run don't actually hit this
problem (only 1 of them uses a test like this) The other stuff, I set an
ACL var to no, set to yes on some conditions, and later I just use
condition = $acl_XX

> Then at some point in the future (Exim 5?) reintroduce the current
> behavior, but make sure it's covered in the release notes. People are a
> lot more likely to read release notes and preform testing when upgrading
> to a new major-version.


I wouldn't be infavor of this. As demonstrated with perl (even with
warnings), it works. The commonality here between exim and perl is that
exim has no idea of integers in the config file so it converts when
testing.

I don't know about python or PHP. I don't use either.

Just testing with bash:
# echo $(())
0
#

--
Lab tests show that use of micro$oft causes cancer in lab animals
Got Gas???