Ticket #665 (closed patch: fixed)
Pmc2c gets confused when name in "pmclass" line mismatches the filename
Reported by: | Infinoid | Owned by: | Infinoid |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | none | Version: | 1.1.0 |
Severity: | medium | Keywords: | |
Cc: | Language: | ||
Patch status: | applied | Platform: |
Description
From darbelo++'s report:
pmc2c gnerates .h files named after the input file, but includes files based on the PMC name. This was a factor on yesterday's 'sploding. It's easy to work around: Name your files the same as your PMC (or the other way around), but it feels like a bug to me. /-- $ cat foo.pmc pmclass bar { } # pmc2c --dump, pmc2c --c, etc. $ ls *h pmc_foo.h $ grep include foo.c #include "parrot/parrot.h" #include "parrot/extend.h" #include "parrot/dynext.h" #include "pmc_bar.h" #include "pmc_default.h" #include "bar.str" #include "pmc_continuation.h" #include "pmc_default.h" <darbelo> I have a PMC named bar in a file name foo.pmc. <darbelo> pmc2c generates pmc_foo.h
So pmc2c has inconsistent header file handling when the pmclass name doesn't match the filename (other than the pmclass name being capitalized).
I'm not sure whether we want to support different names. If so, pmc2c needs to be fixed up. If not, it might help if pmc2c emits a big nasty error message about it... apparently this was the cause of much head-scratching.
Here's a patch to emit a big nasty error message. I'm not sure whether it needs a deprecation cycle or not; it's conceiveable that some HLL out there relies on this (rather insane) behavior.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.