From patchwork Mon Jul 3 18:43:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Li X-Patchwork-Id: 9823829 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C4183604D9 for ; Mon, 3 Jul 2017 18:43:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B44AF27F3E for ; Mon, 3 Jul 2017 18:43:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A64222856D; Mon, 3 Jul 2017 18:43:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_TVD_MIME_EPI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D723327F3E for ; Mon, 3 Jul 2017 18:43:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754180AbdGCSn2 (ORCPT ); Mon, 3 Jul 2017 14:43:28 -0400 Received: from mail-pg0-f54.google.com ([74.125.83.54]:35843 "EHLO mail-pg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754143AbdGCSn1 (ORCPT ); Mon, 3 Jul 2017 14:43:27 -0400 Received: by mail-pg0-f54.google.com with SMTP id u62so98726667pgb.3 for ; Mon, 03 Jul 2017 11:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to:cc; bh=k6lJNxx7d4ktc9BFZgcS2yBQXnW0/iPwSxFZhAlhpcg=; b=C5fzTRX2/xOs7toQa8NSV65luWWiepQdJeXed0xrjM8xXCczVZnMGngEwmmLLEpMI4 4vped7gl26gTSSpSFD1CiUC4ZYWIFpGlD9FNOqB9+a3740Cp7cN5rLvYDOSknElYuHEO HmjPo+Hf5N5OvAMHGGjLE0wJ18jgXvuK/bgO/m92KRgZ8wAnjq16Ogei7yjAZJPyBGmr yBHw8JgvsXXJ7nVwu/lUAEryZVPvq7cwSZYtUcdj6JH5h10lC3yv9yC3iDSx3XDVE6xd LYUpcBp83dF3/DyHFRZnLoam5aGFNbagAXnNK7bZ1VCz8KYRq6PiunIQVKwOAFPRxele SMpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to:cc; bh=k6lJNxx7d4ktc9BFZgcS2yBQXnW0/iPwSxFZhAlhpcg=; b=tdoKjY9N4tvqK36RA/Xp0n99mLuoLmPQYB1BD7y3ZOi3gIYYmQumZmH4bfE6qOFAFr SwRkvd1GGAfGGmiW7QqUPYq0xZ0F0kBXxDwsqFD1XbTi7J9MxnrXk8yclTUh3mEpJhJN 1rg7jXhrocJF/ncu2oGY95YgAbFbrhixc3OkQxo6PrpM6t0br1IZJsSIwm6Mvs1TE9V8 rAxO05oaR8wSSot9DQtbz2Pv2WHyD6EeJOXKHp3Wv1wsm3eyIgttImCsCYfxmwNVKNrR +8m/y68Tc526TP8jyaVUvFkw1kroTZpQaIL+iv2RRkXBNXG4Is/FM1BZFE3uLpBgdLO8 vdJw== X-Gm-Message-State: AIVw1103d6axydxEBFqOot31u4dwuZLPfpLTTGjRvO/1yOgy05F+umN2 IOPD3rFPDc97TnPNPS5nrY0+Z3RO3IEH X-Received: by 10.98.76.83 with SMTP id z80mr11318718pfa.87.1499107406568; Mon, 03 Jul 2017 11:43:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.149.130 with HTTP; Mon, 3 Jul 2017 11:43:25 -0700 (PDT) From: Christopher Li Date: Mon, 3 Jul 2017 11:43:25 -0700 X-Google-Sender-Auth: L_z7mejtLWm9N3U6PXH3sxD3ASQ Message-ID: Subject: [PATCH 2/2] Add full list of gcc attribute To: Linux-Sparse Cc: Luc Van Oostenryck Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This will greatly reduce the "unknown attribute" warning. Chris From ae8e894dc5b294ef7d31139aa1d19f0bceb82229 Mon Sep 17 00:00:00 2001 From: Christopher Li Date: Mon, 3 Jul 2017 04:18:31 -0700 Subject: [PATCH 2/2] Add full list of gcc attribute This will greatly reduce the "unknown attribute" warning. Signed-off-By: --- gcc-attr-list.h | 204 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ parse.c | 114 +++---------------------------- 2 files changed, 214 insertions(+), 104 deletions(-) create mode 100644 gcc-attr-list.h diff --git a/gcc-attr-list.h b/gcc-attr-list.h new file mode 100644 index 0000000..ec8cf44 --- /dev/null +++ b/gcc-attr-list.h @@ -0,0 +1,204 @@ +GCC_ATTR(BELOW100) +GCC_ATTR(OS_Task) +GCC_ATTR(OS_main) +GCC_ATTR(OS_task) +GCC_ATTR(abi_tag) +GCC_ATTR(absdata) +GCC_ATTR(address) +GCC_ATTR(alias) +GCC_ATTR(aligned) +GCC_ATTR(alloc_align) +GCC_ATTR(alloc_size) +GCC_ATTR(altivec) +GCC_ATTR(always_inline) +GCC_ATTR(artificial) +GCC_ATTR(assume_aligned) +GCC_ATTR(bank_switch) +GCC_ATTR(based) +GCC_ATTR(below100) +GCC_ATTR(bnd_instrument) +GCC_ATTR(bnd_legacy) +GCC_ATTR(bnd_variable_size) +GCC_ATTR(break_handler) +GCC_ATTR(brk_interrupt) +GCC_ATTR(callee_pop_aggregate_return) +GCC_ATTR(cb) +GCC_ATTR(cdecl) +GCC_ATTR(cleanup) +GCC_ATTR(cmse_nonsecure_call) +GCC_ATTR(cmse_nonsecure_entry) +GCC_ATTR(cold) +GCC_ATTR(common) +GCC_ATTR(common_object) +GCC_ATTR(const) +GCC_ATTR(constructor) +GCC_ATTR(critical) +GCC_ATTR(default) +GCC_ATTR(deprecated) +GCC_ATTR(designated_init) +GCC_ATTR(destructor) +GCC_ATTR(disinterrupt) +GCC_ATTR(dllexport) +GCC_ATTR(dllimport) +GCC_ATTR(eightbit_data) +GCC_ATTR(either) +GCC_ATTR(error) +GCC_ATTR(exception) +GCC_ATTR(exception_handler) +GCC_ATTR(externally_visible) +GCC_ATTR(fallthrough) +GCC_ATTR(far) +GCC_ATTR(fast_interrupt) +GCC_ATTR(fastcall) +GCC_ATTR(flatten) +GCC_ATTR(force_align_arg_pointer) +GCC_ATTR(format) +GCC_ATTR(format_arg) +GCC_ATTR(forwarder_section) +GCC_ATTR(function_vector) +GCC_ATTR(gcc_struct) +GCC_ATTR(gnu_inline) +GCC_ATTR(hidden) +GCC_ATTR(hot) +GCC_ATTR(hotpatch) +GCC_ATTR(ifunc) +GCC_ATTR(init_priority) +GCC_ATTR(interfacearm) +GCC_ATTR(internal) +GCC_ATTR(interrupt) +GCC_ATTR(interrupt_handler) +GCC_ATTR(interrupt_thread) +GCC_ATTR(io) +GCC_ATTR(io_low) +GCC_ATTR(isr) +GCC_ATTR(keep_interrupts_masked) +GCC_ATTR(kernel) +GCC_ATTR(kspisusp) +GCC_ATTR(l1_data) +GCC_ATTR(l1_data_A) +GCC_ATTR(l1_data_B) +GCC_ATTR(l1_text) +GCC_ATTR(l2) +GCC_ATTR(leaf) +GCC_ATTR(long_call) +GCC_ATTR(longcall) +GCC_ATTR(lower) +GCC_ATTR(malloc) +GCC_ATTR(may_alias) +GCC_ATTR(maybe_unused) +GCC_ATTR(medium_call) +GCC_ATTR(micromips) +GCC_ATTR(mips16) +GCC_ATTR(mode) +GCC_ATTR(model) +GCC_ATTR(monitor) +GCC_ATTR(ms_abi) +GCC_ATTR(ms_hook_prologue) +GCC_ATTR(ms_struct) +GCC_ATTR(naked) +GCC_ATTR(near) +GCC_ATTR(nested) +GCC_ATTR(nested_ready) +GCC_ATTR(nesting) +GCC_ATTR(nmi) +GCC_ATTR(nmi_handler) +GCC_ATTR(no_address_safety_analysis) +GCC_ATTR(no_caller_saved_registers) +GCC_ATTR(no_icf) +GCC_ATTR(no_instrument_function) +GCC_ATTR(no_profile_instrument_function) +GCC_ATTR(no_reorder) +GCC_ATTR(no_sanitize) +GCC_ATTR(no_sanitize_address) +GCC_ATTR(no_sanitize_thread) +GCC_ATTR(no_sanitize_undefined) +GCC_ATTR(no_split_stack) +GCC_ATTR(no_stack_limit) +GCC_ATTR(noclone) +GCC_ATTR(nocommon) +GCC_ATTR(nocompression) +GCC_ATTR(nodiscard) +GCC_ATTR(noinit) +GCC_ATTR(noinline) +GCC_ATTR(nomicromips) +GCC_ATTR(nomips16) +GCC_ATTR(nonnull) +GCC_ATTR(noplt) +GCC_ATTR(noreturn) +GCC_ATTR(nosave_low_regs) +GCC_ATTR(not_nested) +GCC_ATTR(nothrow) +GCC_ATTR(notshared) +GCC_ATTR(optimize) +GCC_ATTR(packed) +GCC_ATTR(partial_save) +GCC_ATTR(pcs) +GCC_ATTR(persistent) +GCC_ATTR(progmem) +GCC_ATTR(protected) +GCC_ATTR(pure) +GCC_ATTR(reentrant) +GCC_ATTR(regparm) +GCC_ATTR(renesas) +GCC_ATTR(resbank) +GCC_ATTR(reset) +GCC_ATTR(returns_nonnull) +GCC_ATTR(returns_twice) +GCC_ATTR(s390_vector_bool) +GCC_ATTR(saddr) +GCC_ATTR(save_all) +GCC_ATTR(save_volatiles) +GCC_ATTR(saveall) +GCC_ATTR(scalar_storage_order) +GCC_ATTR(sda) +GCC_ATTR(section) +GCC_ATTR(selectany) +GCC_ATTR(sentinel) +GCC_ATTR(shared) +GCC_ATTR(short_call) +GCC_ATTR(shortcall) +GCC_ATTR(signal) +GCC_ATTR(simd) +GCC_ATTR(sp_switch) +GCC_ATTR(spu_vector) +GCC_ATTR(sseregparm) +GCC_ATTR(stack_protect) +GCC_ATTR(stdcall) +GCC_ATTR(syscall_linkage) +GCC_ATTR(sysv_abi) +GCC_ATTR(target) +GCC_ATTR(target_clones) +GCC_ATTR(tda) +GCC_ATTR(thiscall) +GCC_ATTR(tiny) +GCC_ATTR(tiny_data) +GCC_ATTR(tls_model) +GCC_ATTR(transaction_callable) +GCC_ATTR(transaction_may_cancel_outer) +GCC_ATTR(transaction_pure) +GCC_ATTR(transaction_safe) +GCC_ATTR(transaction_safe_dynamic) +GCC_ATTR(transaction_unsafe) +GCC_ATTR(transaction_wrap) +GCC_ATTR(transparent_union) +GCC_ATTR(trap_exit) +GCC_ATTR(trapa_handler) +GCC_ATTR(unused) +GCC_ATTR(upper) +GCC_ATTR(use_debug_exception_return) +GCC_ATTR(use_shadow_register_set) +GCC_ATTR(used) +GCC_ATTR(vector) +GCC_ATTR(vector_size) +GCC_ATTR(version_id) +GCC_ATTR(visibility) +GCC_ATTR(vliw) +GCC_ATTR(volatile) +GCC_ATTR(wakeup) +GCC_ATTR(warm) +GCC_ATTR(warn_unused) +GCC_ATTR(warn_unused_result) +GCC_ATTR(warning) +GCC_ATTR(weak) +GCC_ATTR(weakref) +GCC_ATTR(zda) diff --git a/parse.c b/parse.c index 953d04b..02a55a7 100644 --- a/parse.c +++ b/parse.c @@ -540,116 +540,22 @@ static struct init_keyword { { "__word__", NS_KEYWORD, MOD_LONG, .op = &mode_word_op }, }; + static const char *ignored_attributes[] = { - "alias", - "__alias__", - "alloc_align", - "__alloc_align__", - "alloc_size", - "__alloc_size__", - "always_inline", - "__always_inline__", - "artificial", - "__artificial__", - "assume_aligned", - "__assume_aligned__", + +#define GCC_ATTR(x) \ + STRINGIFY(x), \ + STRINGIFY(__##x##__), + +#include "gcc-attr-list.h" + +#undef GCC_ATTR + "bounded", "__bounded__", - "cdecl", - "__cdecl__", - "cold", - "__cold__", - "constructor", - "__constructor__", - "deprecated", - "__deprecated__", - "destructor", - "__destructor__", - "dllexport", - "__dllexport__", - "dllimport", - "__dllimport__", - "error", - "__error__", - "externally_visible", - "__externally_visible__", - "fastcall", - "__fastcall__", - "format", - "__format__", - "format_arg", - "__format_arg__", - "gnu_inline", - "__gnu_inline__", - "hot", - "__hot__", - "hotpatch", - "__hotpatch__", - "leaf", - "__leaf__", - "l1_text", - "__l1_text__", - "l1_data", - "__l1_data__", - "l2", - "__l2__", - "malloc", - "__malloc__", - "may_alias", - "__may_alias__", - "model", - "__model__", - "ms_abi", - "__ms_abi__", - "ms_hook_prologue", - "__ms_hook_prologue__", - "naked", - "__naked__", - "no_instrument_function", - "__no_instrument_function__", - "no_sanitize_address", - "__no_sanitize_address__", - "noclone", "__noclone", - "__noclone__", - "noinline", - "__noinline__", - "nonnull", "__nonnull", - "__nonnull__", - "nothrow", "__nothrow", - "__nothrow__", - "optimize", - "__optimize__", - "regparm", - "__regparm__", - "section", - "__section__", - "sentinel", - "__sentinel__", - "signal", - "__signal__", - "stdcall", - "__stdcall__", - "syscall_linkage", - "__syscall_linkage__", - "sysv_abi", - "__sysv_abi__", - "unused", - "__unused__", - "used", - "__used__", - "vector_size", - "__vector_size__", - "visibility", - "__visibility__", - "warn_unused_result", - "__warn_unused_result__", - "warning", - "__warning__", - "weak", - "__weak__", }; -- 2.9.4