[MDEV-10725] Server 10.1.17 fails to build using clang with c++11 Created: 2016-09-02  Updated: 2016-09-26  Resolved: 2016-09-26

Status: Closed
Project: MariaDB Server
Component/s: Compiling
Affects Version/s: 10.1.17
Fix Version/s: 10.1.18, 5.5.53, 10.0.28

Type: Bug Priority: Major
Reporter: Matthew Kempe Assignee: Sergei Golubchik
Resolution: Fixed Votes: 0
Labels: clang
Environment:

FreeBSD 9.1-p24, amd46
clang 3.4.2 from ports
libc++ 208080 from ports
CXXFLAGS+= -std=c+11 -stdlib=libc+


Sprint: 10.1.18

 Description   

Clang fails to compile with "clang++ -std=c++11" or "clang++ -std=c++11 -stdlib=libc++". Issue was mostly fixed in MySQL in response to this 2012 bug

/usr/ports/databases/mariadb101-server/work/mariadb-10.1.17/sql/sql_view.cc:765:3: error: non-constant-expression cannot be narrowed from type 'size_t' (aka 'unsigned long') to 'int' in initializer list [-Wc++11-narrowing]
  my_offsetof(TABLE_LIST, mariadb_version),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/databases/mariadb101-server/work/mariadb-10.1.17/include/my_global.h:884:9: note: expanded from macro 'my_offsetof'
        ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/ports/databases/mariadb101-server/work/mariadb-10.1.17/sql/sql_view.cc:765:3: note: override this message by inserting an explicit cast
  my_offsetof(TABLE_LIST, mariadb_version),
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  static_cast<int>(                       )
/usr/ports/databases/mariadb101-server/work/mariadb-10.1.17/include/my_global.h:884:9: note: expanded from macro 'my_offsetof'
        ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Generated at Thu Feb 08 07:44:27 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.