Identifier (...) is too long by X characters
Don Clugston
dac at nospam.com.au
Mon Jul 10 23:49:49 PDT 2006
Sean Kelly wrote:
> Don Clugston wrote:
>> Sean Kelly wrote:
>>> Chris Nicholson-Sauls wrote:
>>>> Tom S wrote:
>>>>> ...DMD eats many many rams...
>>>>
>>>> *Gasp!* Those poor sheep/goats!
>>>>
>>>> I would be interested in seeing exactly what your 'Input' mixin
>>>> does. The use of self-referancing returns to initialize it is
>>>> pretty nifty though. Might be a way to get rid of the '.end' at the
>>>> end, though?
>>>>
>>>> The error baffles me, though.
>>>
>>> Symbols are limited to ~255 chars on Win32. I think it's a
>>> limitation of the object file format. "symbol too long" errors are
>>> painfully common in C++, though they're typically truncated to the
>>> max length to allow for debugging.
>>
>> I thought the OMF lib-imposed limit was about 4K. I've just made a
>> template with a symbol name of 480 characters, and that was OK.
>
> Perhaps it is--it's been a while since I developed on Windows. I only
> remember seeing the errors quite often.
>
>> Maybe in the future, we'll be able to add some kind of 'final'
>> declaration to templates, which would indicate that they don't need to
>> be stored in the object file or library, and can be discarded from the
>> symbol table as soon as they are instantiated. This would be
>> particularly useful for recursive templates, which can easily spew
>> reams of garbage into the object file.
>
> This would be nice. I generally expect this to occur anyway, but it
> would be nice to have some sort of insurance.
It definitely happens, but I don't understand why they're in the obj at
all (if I understand correctly, it has to happen that way in C++ because
it's possible for a seperate obj file to provide a specialisation; but
that's not an issue for D).
It's a real problem for the use of metaprogramming with DDL. The .objs
can a be a megabyte in size, but contribute only a hundred bytes to the
final exe. It would make linking much faster if it didn't happen, and it
would probably improve compilation time.
More information about the Digitalmars-d-bugs
mailing list