https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101613
Bug ID: 101613
Summary: Preprocessor add a space between %##s_type
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: preprocessor
Assignee: unassigned at gcc dot gnu.org
Reporter: hjl.tools at gmail dot com
Target Milestone: ---
[hjl@gnu-cfl-2 asm]$ cat foo.S
#define foo(symbol, type) \
foo_1(symbol, type)
#define foo_1(symbol, s_type) \
.type symbol, %##s_type
foo (xxx, object)
[hjl@gnu-cfl-2 asm]$ gcc -c foo.S
foo.S: Assembler messages:
foo.S:6: Error: unrecognized symbol type ""
foo.S:6: Error: junk at end of line, first unrecognized character is `o'
[hjl@gnu-cfl-2 asm]$ gcc -E foo.S
# 0 "foo.S"
# 0 "<built-in>"
# 0 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 0 "<command-line>" 2
# 1 "foo.S"
.type xxx, % object
[hjl@gnu-cfl-2 asm]$
Assembler doesn't expect space between % and object.