Skip to content

Arrow operator on arrays #662

@runelauridsen

Description

@runelauridsen

If the arrow operator is used on an array, then the debugger currently shows a blank cell, while in C it would access the first element.

I often use a single-element array for stack variables that are repeatedly passed by pointer. Example:


void inner(string_builder *sb, ...);

void outer()
{
    string_builder sb[1] = {0};
    inner(sb, ...);
    inner(sb, ...);
    inner(sb, ...);
    inner(sb, ...);
    inner(sb, ...);
}

Within inner, both sb->some_field and sb[0].some_field work, but within outer, only sb[0].some_field produces a result. It would be convenient if some_field could be accessed in both inner and outer using the arrow operator, like in C.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions