Issue Details (XML | Word | Printable)

Key: PCC-274
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Anders Magnusson
Reporter: Iain Hibbert
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.

"out of macro space!" continued..

Created: 15/Mar/11 12:43 PM   Updated: 19/Mar/11 11:34 AM
Component/s: C preprocessor
Affects Version/s: None
Fix Version/s: None

Environment: NetBSD/i386

 Description  « Hide
The following code fragment

#define twice(a) a a

#define foo XX /* comment with single ' */

#define FOO twice(foo)



when compiled with "pcc -E -Wp,-CC" fails with the "out of macro space!" error, even with the recent increase of SBSIZE

So essentially, a macro which calls another macro with an argument which is a macro containing a comment with a single apostrophe where the second macro places the third macro more than once, will fail.

I don't know if helpful or relevant, but without the succeeding lines, cpp will coredump with the following backtrace

#0 sloscan () at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/token.c:447
#1 0x0804a6dd in delwarn () at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/cpp.c:1073
#2 0x0804b76c in subarg (nl=<value optimized out>, args=0xbfbfdb78, lvl=3)
    at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/cpp.c:1509
#3 0x0804b0e4 in submac (sp=0xbb901600, lvl=2)
    at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/cpp.c:1306
#4 0x0804b540 in exparg (lvl=1) at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/cpp.c:1594
#5 0x0804be77 in kfind (sp=0xbb901640) at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/cpp.c:1116
#6 0x0804e7ed in fastscan () at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/token.c:375
#7 0x0804e92a in pushfile (file=0xbfbff627 "x.c", fn=0xbfbff627 "x.c", idx=0, incs=0x0)
    at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/token.c:826
#8 0x0804c65f in main (argc=134549446, argv=0xbfbfe220)
    at /var/cvs/NetBSD-current/src/external/bsd/pcc/libexec/cpp/../../dist/pcc/cc/cpp/cpp.c:289

(also, it works correctly without the -Wp,-CC)

 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Anders Magnusson added a comment - 19/Mar/11 11:34 AM
Should be fixed now, please sanity check.