summaryrefslogtreecommitdiff
path: root/sql/table.h
diff options
context:
space:
mode:
authorDavi Arnaut <Davi.Arnaut@Sun.COM>2010-06-10 17:45:22 -0300
committerDavi Arnaut <Davi.Arnaut@Sun.COM>2010-06-10 17:45:22 -0300
commit53b8829682307224a8b5a9de814019926eea9bd7 (patch)
tree676cbb2ee0c8122ad5c35cc014e428700958b280 /sql/table.h
parentbb036c93b44b8342c3bea1b07e5b7644189d36c0 (diff)
downloadmariadb-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/table.h')
-rw-r--r--sql/table.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/table.h b/sql/table.h
index 4125c252427..3ef3c5e0cb2 100644
--- a/sql/table.h
+++ b/sql/table.h
@@ -1165,7 +1165,7 @@ struct TABLE_LIST
}
/*
- List of tables local to a subquery (used by SQL_LIST). Considers
+ List of tables local to a subquery (used by SQL_I_List). Considers
views as leaves (unlike 'next_leaf' below). Created at parse time
in st_select_lex::add_table_to_list() -> table_list.link_in_list().
*/