Movatterモバイル変換


[0]ホーム

URL:


Next:, Previous:, Up:Other Extensions to C Syntax   [Contents][Index]


6.12.8 Support foroffsetof

GCC implements for both C and C++ a syntactic extension to implementtheoffsetof macro.

primary:        "__builtin_offsetof" "("typename "," offsetof_member_designator ")"offsetof_member_designator:identifier        | offsetof_member_designator "."identifier        | offsetof_member_designator "["expr "]"

This extension is sufficient such that

#define offsetof(type,member)  __builtin_offsetof (type,member)

is a suitable definition of theoffsetof macro. In C++,typemay be dependent. In either case,member may consist of a singleidentifier, or a sequence of member accesses and array references.


[8]ページ先頭

©2009-2026 Movatter.jp