This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: comparing undefined symbols with constants
>>> On 29.01.18 at 12:24, <amodra@gmail.com> wrote:
> On Mon, Jan 29, 2018 at 02:45:34AM -0700, Jan Beulich wrote:
>> >>> On 29.01.18 at 00:29, <amodra@gmail.com> wrote:
>> > On Thu, Jan 25, 2018 at 03:17:40AM -0700, Jan Beulich wrote:
>> >> as the documentation doesn't clarify this, I'd like to understand
>> >> whether "<undefined> == <constant>" being always false, and
>> >> "<undefined> != <constant>" being always true is really intended
>> >> to be that way.
>> >
>> > Yes, I think so.
>>
>> Interesting. This, as explained, not being correct in certain cases is
>> not considered a problem then?
>
> I don't see the problem. gas is a single-pass assembler. A
> conditional expression should evaluate with values (or lack of values)
> at the point the expression is used.
Well, "lack of value" means exactly that, i.e. comparing with an
undefined symbol can't possibly be true or false. Hence the
expectation that an absolute expression would instead be
demanded by the assembler, instead of assuming that undefined
is unequal to anything.
Jan