#561 closed defect (wontfix)

asm.h/preprocessor macros vs. ANSI

Reported by: Ralf Corsepius Owned by: Ralf Corsepius
Priority: high Milestone: 4.8
Component: score Version: 4.7
Severity: critical Keywords:
Cc: bugs@…, ralf.corsepius@… Blocked By:
Blocking:

Description

It seems to me that most (all?) standard RTEMS ASM macros in cpukit/score/<cpu>/asm.h are not ANSI compliant:

For example cpukit/score/m68k/asm.h contains this:
..
/* ANSI concatenation macros. */

#define CONCAT1(a, b) CONCAT2(a, b)
#define CONCAT2(a, b) a ## b

/* Use the right prefix for global labels. */

#define SYM(x) CONCAT1 (USER_LABEL_PREFIX, x)

/* Use the right prefix for registers. */

#define REG(x) CONCAT1 (REGISTER_PREFIX, x)
..

Release:
RTEMS-4.7

Environment:
gcc-3.3.x

How-To-Repeat:
D/L the file from the attachment and try to compile it for the m68k.

# m68k-rtems4.7-gcc -o gaga.i -P gaga.c
gaga.c:22:8: pasting "%" and "foo" does not give a valid preprocessing token
gaga.c:22: error: parse error before '%' token

This kind of errors occur when compiling *.S files from BSPs that have been converted to using automake compilation rules. "non-automade" BSPs use custom compliation rules/flags and get away without this problem showing up.

Attachments (1)

gaga.c (436 bytes) - added by Ralf Corsepius on Dec 3, 2006 at 1:31:13 PM.
gaga.c

Download all attachments as: .zip

Change History (7)

comment:1 Changed on Jan 27, 2004 at 5:48:13 PM by Joel Sherrill

Status: assignedwaiting

comment:2 Changed on Jan 28, 2004 at 1:02:31 PM by Ralf Corsepius

Status: waitingsuspended

comment:3 Changed on Jan 29, 2004 at 2:39:13 PM by Ralf Corsepius

Status: suspendedassigned

Changed on Dec 3, 2006 at 1:31:13 PM by Ralf Corsepius

Attachment: gaga.c added

gaga.c

comment:4 Changed on Jan 15, 2007 at 8:18:42 AM by Ralf Corsepius

Milestone: 4.8
rep_platform: All
Status: newassigned

comment:5 Changed on Jan 15, 2007 at 8:19:10 AM by Ralf Corsepius

Owner: changed from Joel Sherrill to Ralf Corsepius
Status: assignednew

comment:6 Changed on Jan 15, 2007 at 8:19:56 AM by Ralf Corsepius

Resolution: wontfix
Status: newclosed

/me thinks this bug has been resolved a long time ago.

Note: See TracTickets for help on using tickets.