float init 0 request

libxmoc libxmoc at gmail.com
Sun Aug 16 08:30:06 UTC 2026


On Sunday, 16 August 2026 at 02:33:42 UTC, Walter Bright wrote:
> On 8/15/2026 3:13 AM, pete wrote:
>> (this is what C/C++ does for example and copying code examples 
>> from the web will have some C code such as:
>> 
>> ```
>> typedef struct VkClearDepthStencilValue {
>>      float       depth;
>>      uint32_t    stencil;
>> } VkClearDepthStencilValue;
>> 
>> VkClearDepthStencilValue depthStencilClear = {
>>      .stencil = 0
>> };
>
> If you leave it as a C file, and then import it using Import C, 
> the default initializer for `.depth` with be 0.0. (!!)

Would scoping 0 initialization to extern(C) struct (or under 
-betterC) make sense as a compromise?


More information about the Digitalmars-d mailing list