Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1329484

Re: [PATCH] locking/static_keys: avoid nested functions

From Jason Baron <jbaron@akamai.com>
Newsgroups linux.kernel
Subject Re: [PATCH] locking/static_keys: avoid nested functions
Date 2016-02-08 20:10 +0100
Message-ID <qZZma-15p-5@gated-at.bofh.it> (permalink)
References <qZV8S-6zW-45@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 02/08/2016 09:36 AM, Arnd Bergmann wrote:
> clang does not support nested functions inside of an array definition:
> 
> lib/test_static_keys.c:105:16: error: function definition is not allowed here
>                         .test_key       = test_key_func(&old_true_key, static_key_true),
> lib/test_static_keys.c:50:20: note: expanded from macro 'test_key_func'
>         ({bool func(void) { return branch(key); } func; })
> 
> That code appears to have been a little too clever, so this
> simplifies it a bit by defining functions outside of the array.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  lib/test_static_keys.c | 62 ++++++++++++++++++++++++++++++++++----------------
>  1 file changed, 42 insertions(+), 20 deletions(-)
> 

Works for me.

Acked-by: Jason Baron <jbaron@akamai.com>

Thanks,

-Jason

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] locking/static_keys: avoid nested functions Arnd Bergmann <arnd@arndb.de> - 2016-02-08 15:40 +0100
  Re: [PATCH] locking/static_keys: avoid nested functions Jason Baron <jbaron@akamai.com> - 2016-02-08 20:10 +0100

csiph-web