gcc 5.2.0: fix linking issues caused by inline keyword 63/47663/2 accepted/tizen/common/20170102.152246 accepted/tizen/ivi/20170102.223051 accepted/tizen/mobile/20170102.223000 accepted/tizen/tv/20170102.223016 accepted/tizen/wearable/20170102.223034 submit/tizen/20170102.072028
authorPatrick Ohly <patrick.ohly@intel.com>
Mon, 7 Sep 2015 18:40:49 +0000 (20:40 +0200)
committerSunmin Lee <sunm.lee@samsung.com>
Wed, 6 Jul 2016 06:43:54 +0000 (23:43 -0700)
commita1e98bede1352bb39b244f7d58ab80c8e57e1ea5
tree84cda0155c03526dad61671d62b52294e1fcc6cd
parenta9dd2a16b8b5677b0ad4ea19fb2689fbb5ef88a4
gcc 5.2.0: fix linking issues caused by inline keyword

Under gcc 5.2.0, using the inline keyword on function declarations in
a header file without also providing the implementation leads first to
warnings, then during linking of a library using the functions to an
error:

 In file included from shared-api.c:48:0:
 init.h:27:13: warning: inline function 'initialize' declared but never defined
  inline void initialize(struct tzplatform_context *context);
 ...
 init.c:426:29: warning: 'metafilepath' is static but used in inline function 'initialize' which is not static
                  keyname(i), metafilepath);
 ...
 ./.libs/libtzplatform-config-2.0.so: undefined reference to `initialize'
 ./.libs/libtzplatform-config-2.0.so: undefined reference to `hashid'
 ./.libs/libtzplatform-config-2.0.so: undefined reference to `get_uid'
 collect2: error: ld returned 1 exit status
 Makefile:573: recipe for target 'tzplatform-get' failed

This kind of inlining cannot have worked before; probably older gcc
simply ignored the keyword (untested). Therefore removing the keyword
is the quickest way to get the code to compile again as before. A more
intrusive change would be needed if inlining is really important.

Change-Id: Ic88350071ddb2df6bf571ed60b3cf6d443aba742
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
src/context.c
src/context.h
src/hashing.c
src/hashing.h
src/init.c
src/init.h