git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 2fb7a75) | patch
Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.
2015年2月20日 05:11:42 +0000 (00:11 -0500)
2015年2月20日 05:11:42 +0000 (00:11 -0500)
commit 09d8d110a604e52216102e73fb8475b7aa88f1d1
Use FLEXIBLE_ARRAY_MEMBER in a bunch more places.

Replace some bogus "x[1]" declarations with "x[FLEXIBLE_ARRAY_MEMBER]".
Aside from being more self-documenting, this should help prevent bogus
warnings from static code analyzers and perhaps compiler misoptimizations.

This patch is just a down payment on eliminating the whole problem, but
it gets rid of a lot of easy-to-fix cases.

Note that the main problem with doing this is that one must no longer rely
on computing sizeof(the containing struct), since the result would be
compiler-dependent. Instead use offsetof(struct, lastfield). Autoconf
also warns against spelling that offsetof(struct, lastfield[0]).

Michael Paquier, review and additional fixes by me.
44 files changed:
contrib/cube/cubedata.h diff | blob | blame | history
contrib/intarray/_int.h diff | blob | blame | history
contrib/ltree/ltree.h diff | blob | blame | history
contrib/pageinspect/rawpage.c diff | blob | blame | history
contrib/pg_trgm/trgm.h diff | blob | blame | history
src/backend/catalog/namespace.c diff | blob | blame | history
src/backend/commands/prepare.c diff | blob | blame | history
src/backend/executor/functions.c diff | blob | blame | history
src/backend/executor/spi.c diff | blob | blame | history
src/backend/nodes/params.c diff | blob | blame | history
src/backend/postmaster/syslogger.c diff | blob | blame | history
src/backend/tcop/postgres.c diff | blob | blame | history
src/backend/utils/adt/geo_ops.c diff | blob | blame | history
src/backend/utils/cache/catcache.c diff | blob | blame | history
src/bin/pg_dump/dumputils.c diff | blob | blame | history
src/bin/pg_dump/dumputils.h diff | blob | blame | history
src/include/access/gin_private.h diff | blob | blame | history
src/include/access/gist_private.h diff | blob | blame | history
src/include/access/heapam_xlog.h diff | blob | blame | history
src/include/access/spgist_private.h diff | blob | blame | history
src/include/access/xact.h diff | blob | blame | history
src/include/c.h diff | blob | blame | history
src/include/catalog/namespace.h diff | blob | blame | history
src/include/commands/dbcommands.h diff | blob | blame | history
src/include/commands/tablespace.h diff | blob | blame | history
src/include/executor/hashjoin.h diff | blob | blame | history
src/include/nodes/bitmapset.h diff | blob | blame | history
src/include/nodes/params.h diff | blob | blame | history
src/include/nodes/tidbitmap.h diff | blob | blame | history
src/include/postgres.h diff | blob | blame | history
src/include/postmaster/syslogger.h diff | blob | blame | history
src/include/replication/walsender_private.h diff | blob | blame | history
src/include/storage/bufpage.h diff | blob | blame | history
src/include/storage/fsm_internals.h diff | blob | blame | history
src/include/storage/standby.h diff | blob | blame | history
src/include/tsearch/dicts/regis.h diff | blob | blame | history
src/include/tsearch/dicts/spell.h diff | blob | blame | history
src/include/tsearch/ts_type.h diff | blob | blame | history
src/include/utils/catcache.h diff | blob | blame | history
src/include/utils/datetime.h diff | blob | blame | history
src/include/utils/geo_decls.h diff | blob | blame | history
src/include/utils/jsonb.h diff | blob | blame | history
src/include/utils/relmapper.h diff | blob | blame | history
src/include/utils/varbit.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /