Opened 4 months ago

Last modified 4 months ago

#8619 new bug

Support anonymous string literals in C-- (OR) give better ASSERT failure messages in C--

Reported by: ezyang Owned by:
Priority: low Milestone:
Component: Compiler Version: 7.7
Keywords: Cc: simonmar
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Other Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

So if I say "foobar" in C--, it turns into:

  section "rodata" {
	fresh_name : bits8[] "foobar\0";
  }

This would let us fix the ASSERT macro in Cmm.h to also get the filename. Requires parser changes.

Alternatively, we can redefine the ASSERT macro per C-- file to have a hardcoded filename with some preprocessor trickery.

Change History (2)

comment:1 Changed 4 months ago by carter

This would also pave the way to supporting static data structures more generally right?

comment:2 Changed 4 months ago by ezyang

No, you can already specify data to be placed in a read-only data section; the only reason really to want string literals is convenience and macro situations like ASSERT.

Note: See TracTickets for help on using tickets.