[PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef

Ian Jackson posted 1 patch 2 years, 6 months ago
Failed in applying to current master (apply log)
tools/libs/light/CODING_STYLE | 10 ++++++++++
1 file changed, 10 insertions(+)
[PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef
Posted by Ian Jackson 2 years, 6 months ago
We don't use ifdefs in the main code.  Actually document this.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 tools/libs/light/CODING_STYLE | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tools/libs/light/CODING_STYLE b/tools/libs/light/CODING_STYLE
index 3d572f6925..c2342c9d3b 100644
--- a/tools/libs/light/CODING_STYLE
+++ b/tools/libs/light/CODING_STYLE
@@ -121,6 +121,16 @@ permitted exceptions to the usual libxl code formatting rules.
 
 
 
+ARCHITECTURE-SPECIFIC CODE, CONDITIONAL COMPILATION
+---------------------------------------------------
+
+Architecture-specific code should be isolated in libxl_<arch>.c,
+with a function call interface, whereever possible.
+
+#ifdefs should be avoided, and in any case not interspersed through
+the primary functional code.
+
+
 IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
 --------------------------------------------------
 
-- 
2.20.1


Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef
Posted by Anthony PERARD 2 years, 6 months ago
On Tue, Oct 12, 2021 at 03:52:26PM +0100, Ian Jackson wrote:
> We don't use ifdefs in the main code.  Actually document this.
> 
> Signed-off-by: Ian Jackson <iwj@xenproject.org>
> ---
>  tools/libs/light/CODING_STYLE | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/tools/libs/light/CODING_STYLE b/tools/libs/light/CODING_STYLE
> index 3d572f6925..c2342c9d3b 100644
> --- a/tools/libs/light/CODING_STYLE
> +++ b/tools/libs/light/CODING_STYLE
> @@ -121,6 +121,16 @@ permitted exceptions to the usual libxl code formatting rules.
>  
>  
>  
> +ARCHITECTURE-SPECIFIC CODE, CONDITIONAL COMPILATION
> +---------------------------------------------------
> +
> +Architecture-specific code should be isolated in libxl_<arch>.c,
> +with a function call interface, whereever possible.

s/whereever/wherever/ ?

> +
> +#ifdefs should be avoided, and in any case not interspersed through
> +the primary functional code.
> +
> +
>  IDEMPOTENT DATA STRUCTURE CONSTRUCTION/DESTRUCTION
>  --------------------------------------------------
>  

Sounds good,

Acked-by: Anthony PERARD <anthony.perard@citrix.com>

-- 
Anthony PERARD

Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef [and 1 more messages]
Posted by Ian Jackson 2 years, 6 months ago
Anthony PERARD writes ("Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef"):
> On Tue, Oct 12, 2021 at 03:52:26PM +0100, Ian Jackson wrote:
> > +Architecture-specific code should be isolated in libxl_<arch>.c,
> > +with a function call interface, whereever possible.
> 
> s/whereever/wherever/ ?

Fixed, thanks.

> Acked-by: Anthony PERARD <anthony.perard@citrix.com>

Juergen Gross writes ("Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef"):
> Reviewed-by: Juergen Gross <jgross@suse.com>

And committed.

Thanks,
Ian.

Re: [PATCH] libxl: CODING_STYLE: Explicitly deprecate #ifdef
Posted by Juergen Gross 2 years, 6 months ago
On 12.10.21 16:52, Ian Jackson wrote:
> We don't use ifdefs in the main code.  Actually document this.
> 
> Signed-off-by: Ian Jackson <iwj@xenproject.org>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen