Bug 101613 - Preprocessor adds a space between %##s_type
Summary: Preprocessor adds a space between %##s_type
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 12.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-24 12:54 UTC by H.J. Lu
Modified: 2022-12-29 03:14 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.1.2, 5.1.0
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2021-07-24 12:54:33 UTC
[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.