[MDEV-8053] [PATCH] move to c99 style for structure members Created: 2015-04-25  Updated: 2015-05-11  Resolved: 2015-05-11

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB, Storage Engine - XtraDB
Affects Version/s: 5.5.42, 10.0.17
Fix Version/s: 5.5.44, 10.1.5

Type: Bug Priority: Major
Reporter: Daniel Black Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: clang, patch
Environment:

clang-3.4


Issue Links:
Relates
relates to MDEV-6262 analyze the coverity report on mariadb Open

 Description   

While getting travis-ci ready I'm testing with gcc and clang.

clang is a lot more fussy and generates pages of warnings. There is an output limit in travis-ci that these warnings cause to exceed. These warnings overall contribute to about 1/2 the output.

C99 isn't too much of a leap forward from C89

patch: https://github.com/MariaDB/server/pull/52



 Comments   
Comment by Daniel Black [ 2015-04-28 ]

mariadb-10.1 has those definitions in the include file so 10.1 patch here: https://github.com/MariaDB/server/pull/54

Comment by Jan Lindström (Inactive) [ 2015-05-06 ]

Merged pull requests.

Comment by Jan Lindström (Inactive) [ 2015-05-07 ]

Daniel,

Some of the compiler(s) do not like this: /home/buildbot/buildbot/build/mariadb-10.1.5/storage/xtradb/handler/i_s.cc:348:3: error: expected primary-expression before ‘.’ token

Comment by Daniel Black [ 2015-05-07 ]

which ones/versions?

Can a compiler preprocessor definition be used to push these compiles to the alternate #else initialisation?

Comment by Jan Lindström (Inactive) [ 2015-05-07 ]

c99 style initializers require gcc 4.7

e.g http://buildbot.askmonty.org/buildbot/builders/kvm-deb-jessie-amd64/builds/4/steps/compile/logs/stdio

Need to use CHECK_C_SOURCE_COMPILES() in cmake and define some HAVE_xxx that can then be used as compiler preprocessor definition.

Comment by Jan Lindström (Inactive) [ 2015-05-07 ]

Buildbot compiler problems.

Comment by Daniel Black [ 2015-05-07 ]

I was going off https://mariadb.com/kb/en/mariadb/building-mariadb-release-on-ubuntu-1204-lts-precise-pangolin/ and assuming 4.7 was the minimum version.

Comment by Daniel Black [ 2015-05-07 ]

nice fix on commits list. thanks.

Comment by Jan Lindström (Inactive) [ 2015-05-11 ]

commit 3832bda1ba9f31294d57b565030ea3f5d35e6a82
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Thu May 7 14:00:14 2015 +0300

Fix compiler error if compiler does not support c99 style
initializers.

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