@@ -4102,44 +4102,42 @@ def ClangRandstructDocs : Documentation {
4102
4102
let Heading = "randomize_layout, no_randomize_layout";
4103
4103
let Content = [{
4104
4104
The attributes ``randomize_layout`` and ``no_randomize_layout`` can be applied
4105
- to a C struct or class(???) .
4105
+ to a record .
4106
4106
4107
- ``randomize_layout`` instructs the compiler to randomize the memory location
4108
- of the member variables of the struct or class(???). Functions will not be
4109
- shuffled, unless in the event that the member is a function pointer, then it
4110
- will be shuffled as a normal member variable.
4107
+ ``randomize_layout`` instructs the compiler to randomize the memory layout
4108
+ of the member variables of the record.
4111
4109
4112
4110
Conversely, ``no_randomize_layout`` is used to indicate that if using the
4113
- Automatic Strucuture Selection feature of the Randstruct implementation, the
4114
- compiler should not shuffle the members of the struct .
4111
+ automatic strucuture selection feature of the Randstruct implementation, the
4112
+ compiler should not shuffle the members of the record .
4115
4113
4116
- If in the event that a struct or class(???) is labeled with both attributes,
4117
- the compiler will emit a warning indicating that these two cannot be used on
4118
- the same struct of class(???). The default behavior in this case is to not
4119
- randomize the struct, as the attribute ``no_randomize_layout`` takes precedence
4120
- over ``randomize_layout`` .
4114
+ In the event that a record is labeled with both attributes, the compiler will
4115
+ emit a warning indicating that these two cannot be used on the same record.
4116
+ The default behavior in this case is to not randomize the struct, as the
4117
+ attribute ``no_randomize_layout`` takes precedence over ``randomize_layout``.
4118
+ This is implementation defined behavior .
4121
4119
4122
4120
.. code-block:: c
4123
4121
4124
4122
// Indicates that this struct should be randomized by Randstruct implementation.
4125
- struct __attribute__((randomize_layout)) s {
4123
+ struct s {
4126
4124
char *a;
4127
4125
char *b;
4128
4126
char *c;
4129
- };
4127
+ }__attribute__((randomize_layout)) ;
4130
4128
4131
4129
// Indicates that this struct should NOT be randomized by Randstruct implementation.
4132
- struct __attribute__((no_randomize_layout)) s {
4130
+ struct s {
4133
4131
char *a;
4134
4132
char *b;
4135
4133
char *c;
4136
- };
4134
+ }__attribute__((no_randomize_layout)) ;
4137
4135
4138
4136
// Emits compiler warning. Struct is NOT randomized by Randstruct implementation.
4139
- struct __attribute__((randomize_layout)) __attribute__((no_randomize_layout)) s {
4137
+ struct s {
4140
4138
char *a;
4141
4139
char *b;
4142
4140
char *c;
4143
- };
4141
+ }__attribute__((randomize_layout)) __attribute__((no_randomize_layout)) ;
4144
4142
}];
4145
4143
}
0 commit comments