#35 ✓resolved
Peter Johnson

syntax of labels is *too much* flexible

Reported by Peter Johnson | June 25th, 2011 @ 07:48 PM | in 0.4.0 (closed)

Originally posted on Trac by vclaudepierre@tiscali.fr
Original Trac Ticket

  Description

  @@@

Hello

I once coded :
[text] ... gotoPM64
... %include "mymacros.inc" ;contains the macro gotoPM64

=> no warnings at all

When I coded :
[text] ... gotoPM64
... gotoPM64
... %include "mymacros.inc" ;contains the macro gotoPM64

=> error : gotoPM64 already defined, etc

then I understood, IIRC that nasm handles a single name as a label, you are not
bound to write the ":" of "mylabel:" So if you code a macro before its
definition, you won't be warned that it compiled... nothing :-(
And a priori this case is worse :

... gotoPM64
... %include "mymacros.inc" ... gotoPM64

=> no error and though the first occurrence of the macro is NOT compiled

IMO the assembler should force the ":"


  
h3. Trac Attachments

h3. Trac Comments
comment:1
    
                  
                  Changed 7 years ago by peter@tortall.net
  NASM by default has the same issue.  However, recent versions of NASM supply a

"-w+orphan-labels" option which enables warnings for this exact case (labels without colons at the end). I will add support for this option to YASM.

  comment:1

              Changed 7 years ago by peter@tortall.net

  Status
    changed from new to assigned

  NASM by default has the same issue.  However, recent versions of NASM supply a

"-w+orphan-labels" option which enables warnings for this exact case (labels without colons at the end). I will add support for this option to YASM.

  Status
    changed from new to assigned

comment:2
    
                  
                  Changed 7 years ago by peter@tortall.net
  Fixed in r1135: added option "-Worphan-labels" to YASM that will warn if a label

is used alone on a line without a trailing colon. The warning is disabled by
default, just like in NASM.

  comment:2

              Changed 7 years ago by peter@tortall.net

  Status
    changed from assigned to resolved

  Resolution
    set to fixed

  Fixed in r1135: added option "-Worphan-labels" to YASM that will warn if a label

is used alone on a line without a trailing colon. The warning is disabled by
default, just like in NASM.

  Status
    changed from assigned to resolved

  Resolution
    set to fixed

No comments found

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Yasm Modular Assembler Project

Shared Ticket Bins

People watching this ticket

Pages