Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty macro args freeze the assembler #739

Closed
Rangi42 opened this issue Feb 15, 2021 · 2 comments · Fixed by #747
Closed

Empty macro args freeze the assembler #739

Rangi42 opened this issue Feb 15, 2021 · 2 comments · Fixed by #747
Labels
bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM

Comments

@Rangi42
Copy link
Contributor

Rangi42 commented Feb 15, 2021

Uncommenting either of those final lines gives an error and stops assembling at that point, without exiting the process.

mac: MACRO
  for i, _NARG
    println "arg ", i+1, ": <\1>"
    shift
  endr
  println
ENDM

  mac ,1,2   ; arg $1: <1> arg $2: <2>
;  mac 3,4,  ; syntax error, unexpected newline, expecting string
;  mac 5,,6  ; syntax error, unexpected ",", expecting string

It's also surprising that the leading ',' in 'mac ,1,2' has no effect.

@Rangi42 Rangi42 added bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM labels Feb 16, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 17, 2021
@ISSOtm
Copy link
Member

ISSOtm commented Feb 17, 2021

Shouldn't empty macro args produce a -Wextra warning?

@Rangi42
Copy link
Contributor Author

Rangi42 commented Feb 17, 2021

I'll add a -Wempty-arg warning for them, sure.

Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 18, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 18, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 19, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 21, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 25, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 28, 2021
Rangi42 added a commit to Rangi42/rgbds that referenced this issue Feb 28, 2021
Rangi42 added a commit that referenced this issue Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected behavior / crashes; to be fixed ASAP! rgbasm This affects RGBASM
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants