Thread overview |
---|
December 15, 2012 Why are const strings used in templates for compile time found in exe | ||||
---|---|---|---|---|
| ||||
The following code http://dpaste.dzfl.pl/64025e0a when compiled, has all the static and const char[] strings used only for compile time inside the executable. How to prevent this? specifically I'm talking about static const char[] __ClassNameFix = "_A!("; static const char[] __NestLevelFix = "_NestLevel"; and all the mixin strings from the templates. They all show up in the executable but are only used for static compilation. (release build with no debug info) |
December 15, 2012 Re: Why are const strings used in templates for compile time found in exe | ||||
---|---|---|---|---|
| ||||
Posted in reply to js.mdnq | On Saturday, 15 December 2012 at 13:08:01 UTC, js.mdnq wrote:
>
> The following code
>
> http://dpaste.dzfl.pl/64025e0a
>
> when compiled, has all the static and const char[] strings used only for compile time inside the executable.
>
> How to prevent this?
>
> specifically I'm talking about
>
> static const char[] __ClassNameFix = "_A!("; static const char[] __NestLevelFix = "_NestLevel";
>
> and all the mixin strings from the templates. They all show up in the executable but are only used for static compilation.
>
> (release build with no debug info)
enum string __ClassNameFix = "_A!(";
|
December 15, 2012 Re: Why are const strings used in templates for compile time found in exe | ||||
---|---|---|---|---|
| ||||
Posted in reply to anonymous | On Saturday, 15 December 2012 at 13:16:17 UTC, anonymous wrote:
> On Saturday, 15 December 2012 at 13:08:01 UTC, js.mdnq wrote:
>>
>> The following code
>>
>> http://dpaste.dzfl.pl/64025e0a
>>
>> when compiled, has all the static and const char[] strings used only for compile time inside the executable.
>>
>> How to prevent this?
>>
>> specifically I'm talking about
>>
>> static const char[] __ClassNameFix = "_A!("; static const char[] __NestLevelFix = "_NestLevel";
>>
>> and all the mixin strings from the templates. They all show up in the executable but are only used for static compilation.
>>
>> (release build with no debug info)
>
> enum string __ClassNameFix = "_A!(";
That works when marking the template static! Thanks.
|
Copyright © 1999-2021 by the D Language Foundation