diff options
author | Geoffrey Keating <geoffk@apple.com> | 2003-04-12 01:43:11 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-04-12 01:43:11 +0000 |
commit | ba05abd3e0f72539ee5bbb5ee2fa360cffd9eeb6 (patch) | |
tree | c486df7bcf5090618193ba0b3723b6d0236d006e /gcc | |
parent | 15c812e3f797b5245679b768aa1b11c718403dea (diff) | |
download | gcc-ba05abd3e0f72539ee5bbb5ee2fa360cffd9eeb6.zip gcc-ba05abd3e0f72539ee5bbb5ee2fa360cffd9eeb6.tar.gz gcc-ba05abd3e0f72539ee5bbb5ee2fa360cffd9eeb6.tar.bz2 |
* doc/extend.texi (Empty Structures): New.
From-SVN: r65497
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/doc/extend.texi | 16 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b288c77..a7968be 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2003-04-11 Geoffrey Keating <geoffk@apple.com> + + * doc/extend.texi (Empty Structures): New. + 2003-04-11 Eric Christopher <echristo@redhat.com> * emit-rtl.c (gen_rtx): Fix typos. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index a265672..ad2a02f 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -436,6 +436,7 @@ extensions, accepted by GCC in C89 mode and in C++. * Hex Floats:: Hexadecimal floating-point constants. * Zero Length:: Zero-length arrays. * Variable Length:: Arrays whose length is computed at run time. +* Empty Structures:: Structures with no members. * Variadic Macros:: Macros with a variable number of arguments. * Escaped Newlines:: Slightly looser rules for escaped newlines. * Multi-line Strings:: String literals with embedded newlines. @@ -1358,6 +1359,21 @@ struct bar c = @{ @{ 1, @{ @} @} @}; // @r{Valid.} struct foo d[1] = @{ @{ 1 @{ 2, 3, 4 @} @} @}; // @r{Invalid.} @end example +@node Empty Structures +@section Structures With No Members +@cindex empty structures +@cindex zero-size structures + +GCC permits a C structure to have no members: + +@example +struct empty @{ +@}; +@end example + +The structure will have size zero. In C++, empty structures are part +of the language, and the language standard says they have size 1. + @node Variable Length @section Arrays of Variable Length @cindex variable-length arrays |