Project

General

Profile

Actions

Feature #220

closed

Alignment attributes

Feature #220: Alignment attributes

Added by Eugen Wissner 4 days ago. Updated about 6 hours ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Language
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Introduction

Attributes share the general syntax with traits: an attribute name is prefixed by # and is followed by arguments. The arguments are type expressions as in the case with traits, but constant expressions.

#aligned(16).

Alignment specified multiple time in the same position should be rejected.

Field alginment

The first attribute that should be supported is #aligned. Alignment can be specified for field and variable declarations. Declaration names are prefixed with attributes. If multiple declarations are separated by a comma (e.g. multiple fields with the same type) the attributes apply only to the immediately following name.

Parameters and fields share the same syntax, but since the parameters do not support alignment, this attribute should be rejected in the positions it is not supported.

Type alignment

Alignment can be also specified on records prefixing the record keyword:

type T = #aligned(16) record … end

The alignment is valid only on the record directly, so "attributed" aliasing like in type A = #aligned(16) R is not supported, even if R is a record.


Related issues 1 (1 open0 closed)

Blocks Feature #221: Extern variadic proceduresNew

Actions

Updated by Eugen Wissner 4 days ago Actions #1

  • Description updated (diff)

Updated by Eugen Wissner 4 days ago Actions #2

  • Description updated (diff)

Updated by Eugen Wissner 4 days ago Actions #3

  • Description updated (diff)

Updated by Eugen Wissner 4 days ago Actions #4

Updated by Eugen Wissner about 6 hours ago Actions #5

  • Status changed from New to Closed
Actions

Also available in: PDF Atom