Skip to content

Formatting of for T : Type of Container loop disagrees with GNAT warning #3

@pyjarrett

Description

@pyjarrett

Noticed in this code snippet, autoformat in VS Code results in this:

 function FNV_1A (S : String) return String_Hash is
 begin
    return Value : String_Hash := 14_695_981_039_346_656_037 do
       for C:Character of S loop
          Value := Value xor Character'Pos (C);
          Value := Value * 1099511628211;
       end loop;
    end return;
 end FNV_1A;

This triggers a GNAT warning: (style) space required [-gnatyt] between the C and : of the for loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions