From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9B59AA09E4; Fri, 29 Jan 2021 21:15:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0E08C4067B; Fri, 29 Jan 2021 21:15:17 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id EA2F840395 for ; Fri, 29 Jan 2021 21:15:14 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611951313; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=he9KrBOxntuatUzKgdnh/2Y+bjz0YZeeHeSvQyG2hO8=; b=NuuHbNBZU/ZssjYvYxVQYCpbhtayWAzSSgOZpxD6/lNNTMyBQ/pNPce2aaUECNFtqUv1pR rBFuzGvF5HXg7oq+cxiZOTTk938QfNGLM3HOLOGEe1PoGwP4iqepK0tZAE5sCLeywDWZrH Cn/ZvmT/qaNGe1Tseog0tIsBYcIf3O4= Received: from mail-vk1-f198.google.com (mail-vk1-f198.google.com [209.85.221.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-404-kqu2guXUOcCj5Vm4_e5NFQ-1; Fri, 29 Jan 2021 15:15:11 -0500 X-MC-Unique: kqu2guXUOcCj5Vm4_e5NFQ-1 Received: by mail-vk1-f198.google.com with SMTP id g201so2766927vke.20 for ; Fri, 29 Jan 2021 12:15:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=he9KrBOxntuatUzKgdnh/2Y+bjz0YZeeHeSvQyG2hO8=; b=G7+wrEyYNcOLOss4gUpSydR6r5U8wWjxCnW3gRUvq0LVGa8OFASfaGOfSOz/DhrT3i lTztwjO38OBp22jiQKvZP+xr4pTO9v/W5xKperEoVyDhcnet35wRowhHFoWQp0XkLJ9x P7qYA1eTRcF+c8Q99FVfHAYenuRctCrYAwGmShd1gClGpzT4LuXmFn007JZyJ629xDQM RUH2UbGZP2Unjq7b6OHgNIjIvzan7KjXbnIQBwQnTJtm4O4e7Q8ugDrrYwjmF7CX8wgn 9padkhJzoegxWfpyY0XJTjmyCOXQmV/WiMWRRnW4AKt4rAV/W2wzxIitPMtO/ZS/oqNn fpNA== X-Gm-Message-State: AOAM532VEdsvNQzCaHE8O3cfYwctql9UzUBdcAXl1b6Vs7HvXSRfxvYM DpnBeZN3NMeiDls83ssMC7+JLT0inTEPcu7q8OCQroEoYiM3cX7Fqhq9e2s8Tc5zOiKVUTA49ok Qopd98W/t0PIbCM4K7vw= X-Received: by 2002:ab0:7087:: with SMTP id m7mr3955301ual.53.1611951311057; Fri, 29 Jan 2021 12:15:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsgXM4U0ftRNWmzLNCtmGfgfYGgxwCXP6iXzURnFil6pAX8EyGnsH1cLhgXkFgIbqgenPNzvHb1VnvJBvtajw= X-Received: by 2002:ab0:7087:: with SMTP id m7mr3955289ual.53.1611951310837; Fri, 29 Jan 2021 12:15:10 -0800 (PST) MIME-Version: 1.0 References: <20210114110606.21142-1-bruce.richardson@intel.com> <20210129164823.3205861-1-bruce.richardson@intel.com> In-Reply-To: <20210129164823.3205861-1-bruce.richardson@intel.com> From: David Marchand Date: Fri, 29 Jan 2021 21:14:59 +0100 Message-ID: To: Bruce Richardson Cc: dev , Thomas Monjalon Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v7 00/10] add checking of header includes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, Jan 29, 2021 at 5:48 PM Bruce Richardson wrote: > > As a general principle, each header file should include any other > headers it needs to provide data type definitions or macros. For > example, any header using the uintX_t types in structures or function > prototypes should include "stdint.h" to provide those type definitions. > > In practice, while many, but not all, headers in DPDK did include all > necessary headers, it was never actually checked that each header could > be included in a C file and compiled without having any compiler errors > about missing definitions. The script "check-includes.sh" could be used > for this job, but it was not called out in the documentation, so many > contributors may not have been aware of it's existance. It also was > difficult to run from a source-code directory, as the script did not > automatically allow finding of headers from one DPDK library directory > to another [this was probably based on running it on a build created by > the "make" build system, where all headers were in a single directory]. > To attempt to have a build-system integrated replacement, this patchset > adds a "chkincs" app in the buildtools directory to verify this on an > ongoing basis. > > This chkincs app does nothing when run, and is not installed as part of > a DPDK "ninja install", it's for build-time checking only. Its source > code consists of one C file per public DPDK header, where that C file > contains nothing except an include for that header. Therefore, if any > header is added to the lib folder which fails to compile when included > alone, the build of chkincs will fail with a suitable error message. > Since this compile checking is not needed on most builds of DPDK, the > building of chkincs is disabled by default, but can be enabled by the > "test_includes" meson option. To catch errors with patch submissions, > the final patch of this series enables it for a single build in > test-meson-builds script. > > Future work could involve doing similar checks on headers for C++ > compatibility, which was something done by the check-includes.sh script > but which is missing here. > > V7: > * fixed issue with compilers not supporting __has_attribute > * added patch to add missing headers to power library .h file > * added patch to make eventdev headers non-public > * renamed headers_no_chkincs to indirect_headers I squashed patch 7/8 as commented by Thomas. The series looks good. Series applied, thanks Bruce. -- David Marchand