bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

as: undocumented evaluation of relational operators generates no syntax-


From: Klaus Borchers
Subject: as: undocumented evaluation of relational operators generates no syntax-err, but yields result -1 if true
Date: Mon, 28 May 2001 23:56:29 +0200

Problem :
Relational operators are not defined in the documentation ("Using as").

However, they are evaluated without generating a syntax-error :

Example: (GNU assembler 2.9.5, target "arm-linux:  as -a asmtest.S  )     

  14 0000 FFFFFFFF                      .word (2 == 2)
  15 0004 00000000                      .word (2 == 6)
  16 0008 00000000                      .word (2 >= 6)
  17 000c FFFFFFFF                      .word (9 >= 6)
  18 0010 FFFFFFFF                      .word (6 >= 6)
  19
  20 0014 FFFFFFFF                      .word (2 == (   16  / 8))

Unfortunately, the result is -1 rather than 1, if the expression evaluates
true.

as 2.9.1 for target 'i686-pc-linux-gnu' evaluates lines 14..18 in the same way,
but fails on the more complicated expression in line 20 :

20 ???? 0000                          .word (2 == (   16  / 8))
****  Error:Missing ')' assumed

Therefore, I think this behaviour is probably unintended.

Since some people might (if even unknowingly) rely on this feature, maybe
just a warning could be issued if there are relational operators found in
expressions .

Best regards, Klaus

   --
Mobotix AG
Klaus Borchers
Luxemburgerstr. 6
D-67657 Kaiserslautern
Germany

Tel: +49 (631) 3033141
Fax: +49 (631) 3033190
E-Mail: address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]