diff options
author | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-06-10 17:45:22 -0300 |
---|---|---|
committer | Davi Arnaut <Davi.Arnaut@Sun.COM> | 2010-06-10 17:45:22 -0300 |
commit | 53b8829682307224a8b5a9de814019926eea9bd7 (patch) | |
tree | 676cbb2ee0c8122ad5c35cc014e428700958b280 /sql/handler.h | |
parent | bb036c93b44b8342c3bea1b07e5b7644189d36c0 (diff) | |
download | mariadb-git-53b8829682307224a8b5a9de814019926eea9bd7.tar.gz |
Bug#42733: Type-punning warnings when compiling MySQL --
strict aliasing violations.
One somewhat major source of strict-aliasing violations and
related warnings is the SQL_LIST structure. For example,
consider its member function `link_in_list` which takes
a pointer to pointer of type T (any type) as a pointer to
pointer to unsigned char. Dereferencing this pointer, which
is done to reset the next field, violates strict-aliasing
rules and might cause problems for surrounding code that
uses the next field of the object being added to the list.
The solution is to use templates to parametrize the SQL_LIST
structure in order to deference the pointers with compatible
types. As a side bonus, it becomes possible to remove quite
a few casts related to acessing data members of SQL_LIST.
Diffstat (limited to 'sql/handler.h')
-rw-r--r-- | sql/handler.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/handler.h b/sql/handler.h index d9dfd4f0707..aa74ca19468 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -910,7 +910,7 @@ typedef struct st_ha_create_information ulong avg_row_length; ulong used_fields; ulong key_block_size; - SQL_LIST merge_list; + SQL_I_List<TABLE_LIST> merge_list; handlerton *db_type; /** Row type of the table definition. |