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

cmd/asm: macro invocation cannot span more than one line #54108

Closed
WojciechMula opened this issue Jul 28, 2022 · 1 comment
Closed

cmd/asm: macro invocation cannot span more than one line #54108

WojciechMula opened this issue Jul 28, 2022 · 1 comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge

Comments

@WojciechMula
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.18.1 linux/amd64

What did you do?

I tried to assemble the following asm code with a macro:

#define TRIPLE_U64(name, x, y, z)          \
    DATA name<>+(0)<SB>, x                 \
    DATA name<>+(8)<SB>, y                 \
    DATA name<>+(16)<SB>, z                \
    GLOBAL name<>(SB), RODATA|NOPTR, 24

TRIPLE_U64(test,
    $1,  // first
    $2,  // second
    $3   // third
)

What did you expect to see?

No errors.

What did you see instead?

Error: unterminated arg list invoking macro: TRIPLE_U64

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 28, 2022
@cherrymui
Copy link
Member

The macro syntax the Go assembler supports is limited. It is intentional to not support all the syntax the C preprocessor. (And, if you run your example in the C preprocessor the result you get might not be what you expected.) Closing as working as intended. Thanks.

@cherrymui cherrymui closed this as not planned Won't fix, can't repro, duplicate, stale Jul 28, 2022
@golang golang locked and limited conversation to collaborators Jul 28, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. FrozenDueToAge
Projects
None yet
Development

No branches or pull requests

3 participants