The counted_by attribute allows specifying that a flexible array member of a struct is "counted by" another member of the same struct. The attribute makes arrays a little more self-documenting, but it is also a hint to the compiler such that it can improve detection of object size information and provide better results in compile-time diagnostics and run-time features, such as the array bounds sanitizer. Both GCC and clang warn when the attribute is used in C++, where it is ignored, so define it away there. In its current form, it is best used for flexible array members only. Pointer array support may come later on. This commit only contains a single use of the attribute for testing. More will be added afterwards. Author: Tristan Partin <tristan@partin.io> Reviewed-by: Peter Eisentraut <peter@eisentraut.org> Reviewed-by: Japin Li <japinli@hotmail.com> Reviewed-by: Greg Burd <greg@burd.me> Discussion: https://www.postgresql.org/message-id/flat/DKBEBF32QLUA.3L2DJRPUYNKHZ%40partin.io
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/devel/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/devel/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.