Ответ:
(«Телесистемы»: Конференция «Микроконтроллеры и их применение»)

миниатюрный аудио-видеорекордер mAVR

Отправлено trainer 07 февраля 2003 г. 16:00
В ответ на: Чего то я не уверен, имею ли я право в С так делать и на какие грабли я потом наступлю (+) отправлено DASM 07 февраля 2003 г. 13:40

А не Ваш ли вопрос на эту же тему на pascal.sources.ru?
Проблемы будут только если будете по неосторожности приводить к типу "указатель на big_part" указатель на объект, не являющийся таковым( что естественно ).
Смещение another members внутри big_part будет всегда одинаковым для данного компилятора и(или) данного режима выравнивания.
У меня стандарта ANSI нет, но в варианте ISO написано:

A structure type describes a sequentially allocated nonempty set of member objects
(and, in certain circumstances, an incomplete array), each of which has an optionally
specified name and possibly distinct type.

...
Each non-bit-field member of a structure or union object is aligned in an implementation defined
manner appropriate to its type.
Within a structure object, the non-bit-field members and the units in which bit-fields
reside have addresses that increase in the order in which they are declared. A pointer to a
structure object, suitably converted, points to its initial member (or if that member is a
bit-field, then to the unit in which it resides), and vice versa. There may be unnamed
padding within a structure object, but not at its beginning.

Составить ответ  |||  Конференция  |||  Архив

Ответы



Перейти к списку ответов  |||  Конференция  |||  Архив  |||  Главная страница  |||  Содержание  |||  Без кадра

E-mail: info@telesys.ru