Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 13 May 2020 12:25:36 +0000 (UTC)
From:      =?UTF-8?Q?Roger_Pau_Monn=c3=a9?= <royger@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r535106 - in head/sysutils/xen-tools: . files
Message-ID:  <202005131225.04DCPahT091317@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: royger (src committer)
Date: Wed May 13 12:25:35 2020
New Revision: 535106
URL: https://svnweb.freebsd.org/changeset/ports/535106

Log:
  sysutils/xen-tools: properly fix Wno-misleading-indentation errors
  
  Backport the commit from upstream in order to properly fix
  Wno-misleading-indentation related errors from the Flex generated
  libxl disk parser.
  
  Sponsored by:	Citrix Systems R&D
  Approved by:	bapt (implicit)

Added:
  head/sysutils/xen-tools/files/0001-tools-libxl-disable-clang-indentation-check-for-the-.patch   (contents, props changed)
Modified:
  head/sysutils/xen-tools/Makefile

Modified: head/sysutils/xen-tools/Makefile
==============================================================================
--- head/sysutils/xen-tools/Makefile	Wed May 13 12:05:35 2020	(r535105)
+++ head/sysutils/xen-tools/Makefile	Wed May 13 12:25:35 2020	(r535106)
@@ -3,7 +3,7 @@
 PORTNAME=	xen
 PKGNAMESUFFIX=	-tools
 PORTVERSION=	4.13.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	sysutils emulators
 MASTER_SITES=	http://downloads.xenproject.org/release/xen/${PORTVERSION}/
 
@@ -42,7 +42,7 @@ USE_LDCONFIG=	yes
 USE_PYTHON=	py3kplist
 HAS_CONFIGURE=	yes
 # Set ARCH=x86_64 in order to overwrite the environment ARCH=amd64
-MAKE_ARGS=	clang=y ARCH=x86_64 EXTRA_CFLAGS_XEN_TOOLS=-Wno-misleading-indentation
+MAKE_ARGS=	clang=y ARCH=x86_64
 
 CONFIGURE_ARGS+=	--with-system-seabios=${LOCALBASE}/share/seabios/bios.bin \
 			--mandir=${MANPREFIX}/man
@@ -57,8 +57,10 @@ DOCS_ALL_TARGET=	docs
 INSTALL_TARGET=		install-tools
 DOCS_INSTALL_TARGET=	install-docs
 
-# Fix build with clang 10.0 (re convert enum constant to boolean)
-EXTRA_PATCHES+= ${PATCHDIR}/0001-libfsimage-fix-clang-10-build.patch:-p1
+# Fix build with clang 10.0 (re convert enum constant to boolean and bad
+# indentation of flex generated parser)
+EXTRA_PATCHES+= ${PATCHDIR}/0001-libfsimage-fix-clang-10-build.patch:-p1 \
+		${PATCHDIR}/0001-tools-libxl-disable-clang-indentation-check-for-the-.patch:-p1
 
 .include <bsd.port.options.mk>
 

Added: head/sysutils/xen-tools/files/0001-tools-libxl-disable-clang-indentation-check-for-the-.patch
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/sysutils/xen-tools/files/0001-tools-libxl-disable-clang-indentation-check-for-the-.patch	Wed May 13 12:25:35 2020	(r535106)
@@ -0,0 +1,691 @@
+From 7d69aae4276977819929a7a3fd1f713b7704245a Mon Sep 17 00:00:00 2001
+From: Roger Pau Monne <roger.pau@citrix.com>
+Date: Tue, 5 May 2020 11:24:54 +0200
+Subject: [PATCH] tools/libxl: disable clang indentation check for the disk
+ parser
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Clang 10 complains with:
+
+13: error: misleading indentation; statement is not part of the previous 'if'
+      [-Werror,-Wmisleading-indentation]
+            if ( ! yyg->yy_state_buf )
+            ^
+libxlu_disk_l.c:1259:9: note: previous statement is here
+        if ( ! yyg->yy_state_buf )
+        ^
+
+Due to the missing braces in single line statements and the wrong
+indentation. Fix this by disabling the warning for that specific file.
+I haven't found a way to force flex to add braces around single line
+statements in conditional blocks.
+
+Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
+[ wei: regenerate output files ]
+Acked-by: Wei Liu <wl@xen.org>
+[roger: regenerate files for 4.13.0]
+---
+ tools/libxl/libxlu_disk_l.c | 172 +++++++++++++++++++-----------------
+ tools/libxl/libxlu_disk_l.h |  32 ++++---
+ tools/libxl/libxlu_disk_l.l |  11 +++
+ 3 files changed, 116 insertions(+), 99 deletions(-)
+
+diff --git a/tools/libxl/libxlu_disk_l.c b/tools/libxl/libxlu_disk_l.c
+index 944990732b..d5ed05473a 100644
+--- a/tools/libxl/libxlu_disk_l.c
++++ b/tools/libxl/libxlu_disk_l.c
+@@ -13,13 +13,23 @@
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
+-#define YY_FLEX_SUBMINOR_VERSION 39
++#define YY_FLEX_SUBMINOR_VERSION 37
+ #if YY_FLEX_SUBMINOR_VERSION > 0
+ #define FLEX_BETA
+ #endif
+ 
+ /* First, we deal with  platform-specific or compiler-specific issues. */
+ 
++#if defined(__FreeBSD__)
++#ifndef __STDC_LIMIT_MACROS
++#define	__STDC_LIMIT_MACROS
++#endif
++#include <sys/cdefs.h>
++#include <stdint.h>
++#else
++#define	__dead2
++#endif
++
+ /* begin standard C headers. */
+ #include <stdio.h>
+ #include <string.h>
+@@ -35,7 +45,8 @@
+ 
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+ 
+-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
++#if defined(__FreeBSD__) || \
++    (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+ 
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+  * if you want the limit (max/min) macros for int types. 
+@@ -163,15 +174,7 @@ typedef void* yyscan_t;
+ 
+ /* Size of default input buffer. */
+ #ifndef YY_BUF_SIZE
+-#ifdef __ia64__
+-/* On IA-64, the buffer size is 16k, not 8k.
+- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+- * Ditto for the __ia64__ case accordingly.
+- */
+-#define YY_BUF_SIZE 32768
+-#else
+ #define YY_BUF_SIZE 16384
+-#endif /* __ia64__ */
+ #endif
+ 
+ /* The state buf must be large enough to hold one state per character in the main buffer.
+@@ -193,7 +196,6 @@ typedef size_t yy_size_t;
+ #define EOB_ACT_LAST_MATCH 2
+ 
+     #define YY_LESS_LINENO(n)
+-    #define YY_LINENO_REWIND_TO(ptr)
+     
+ /* Return all but the first "n" matched characters back to the input stream. */
+ #define yyless(n) \
+@@ -285,6 +287,7 @@ struct yy_buffer_state
+ #define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+                           ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+                           : NULL)
++#define yy_current_buffer YY_CURRENT_BUFFER
+ 
+ /* Same as previous macro, but useful when we know that the buffer stack is not
+  * NULL or when we need an lvalue. For internal use only.
+@@ -349,7 +352,7 @@ typedef int yy_state_type;
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
+ static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
+ static int yy_get_next_buffer (yyscan_t yyscanner );
+-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
++static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ) __dead2;
+ 
+ /* Done after the current pattern has been matched and before the
+  * corresponding action - sets up yytext.
+@@ -887,6 +890,17 @@ goto find_rule; \
+ 
+ #define YY_NO_INPUT
+ 
++/* The code generated by flex is missing braces in single line expressions and
++ * is not properly indented, which triggers the clang misleading-indentation
++ * check that has been made part of -Wall since clang 10. In order to safely
++ * disable it on clang versions that don't have the diagnostic implemented
++ * also disable the unknown option and pragma warning. */
++#ifdef __clang__
++# pragma clang diagnostic ignored "-Wunknown-pragmas"
++# pragma clang diagnostic ignored "-Wunknown-warning-option"
++# pragma clang diagnostic ignored "-Wmisleading-indentation"
++#endif
++
+ /* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
+  * it to fail to declare these functions, which it defines.  So declare
+  * them ourselves.  Hopefully we won't have to simultaneously support
+@@ -1002,7 +1016,7 @@ static int vdev_and_devtype(DiskParseContext *dpc, char *str) {
+ #define DPC ((DiskParseContext*)yyextra)
+ 
+ 
+-#line 1006 "libxlu_disk_l.c"
++#line 1020 "libxlu_disk_l.c"
+ 
+ #define INITIAL 0
+ #define LEXERR 1
+@@ -1135,12 +1149,7 @@ static int input (yyscan_t yyscanner );
+ 
+ /* Amount of stuff to slurp up with each read. */
+ #ifndef YY_READ_BUF_SIZE
+-#ifdef __ia64__
+-/* On IA-64, the buffer size is 16k, not 8k */
+-#define YY_READ_BUF_SIZE 16384
+-#else
+ #define YY_READ_BUF_SIZE 8192
+-#endif /* __ia64__ */
+ #endif
+ 
+ /* Copy whatever the last rule matched to the standard output. */
+@@ -1159,7 +1168,7 @@ static int input (yyscan_t yyscanner );
+ 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ 		{ \
+ 		int c = '*'; \
+-		int n; \
++		size_t n; \
+ 		for ( n = 0; n < max_size && \
+ 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ 			buf[n] = (char) c; \
+@@ -1172,7 +1181,7 @@ static int input (yyscan_t yyscanner );
+ 	else \
+ 		{ \
+ 		errno=0; \
+-		while ( (result = fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
++		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ 			{ \
+ 			if( errno != EINTR) \
+ 				{ \
+@@ -1237,11 +1246,18 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
+  */
+ YY_DECL
+ {
+-	register yy_state_type yy_current_state;
+-	register char *yy_cp, *yy_bp;
+-	register int yy_act;
++	yy_state_type yy_current_state;
++	char *yy_cp, *yy_bp;
++	int yy_act;
+     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ 
++#line 177 "libxlu_disk_l.l"
++
++
++ /*----- the scanner rules which do the parsing -----*/
++
++#line 1260 "libxlu_disk_l.c"
++
+ 	if ( !yyg->yy_init )
+ 		{
+ 		yyg->yy_init = 1;
+@@ -1274,14 +1290,6 @@ YY_DECL
+ 		xlu__disk_yy_load_buffer_state(yyscanner );
+ 		}
+ 
+-	{
+-#line 166 "libxlu_disk_l.l"
+-
+-
+- /*----- the scanner rules which do the parsing -----*/
+-
+-#line 1284 "libxlu_disk_l.c"
+-
+ 	while ( 1 )		/* loops until end-of-file is reached */
+ 		{
+ 		yyg->yy_more_len = 0;
+@@ -1308,7 +1316,7 @@ YY_DECL
+ yy_match:
+ 		do
+ 			{
+-			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
++			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+ 			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ 				{
+ 				yy_current_state = (int) yy_def[yy_current_state];
+@@ -1324,6 +1332,7 @@ yy_match:
+ yy_find_action:
+ 		yy_current_state = *--yyg->yy_state_ptr;
+ 		yyg->yy_lp = yy_accept[yy_current_state];
++goto find_rule; /* avoid `defined but not used' warning */
+ find_rule: /* we branch to this label when backing up */
+ 		for ( ; ; ) /* until we find what rule we matched */
+ 			{
+@@ -1369,135 +1378,135 @@ do_action:	/* This label is used only to access EOF actions. */
+ case 1:
+ /* rule 1 can match eol */
+ YY_RULE_SETUP
+-#line 170 "libxlu_disk_l.l"
++#line 181 "libxlu_disk_l.l"
+ { /* ignore whitespace before parameters */ }
+ 	YY_BREAK
+ /* ordinary parameters setting enums or strings */
+ case 2:
+ /* rule 2 can match eol */
+ YY_RULE_SETUP
+-#line 174 "libxlu_disk_l.l"
++#line 185 "libxlu_disk_l.l"
+ { STRIP(','); setformat(DPC, FROMEQUALS); }
+ 	YY_BREAK
+ case 3:
+ YY_RULE_SETUP
+-#line 176 "libxlu_disk_l.l"
++#line 187 "libxlu_disk_l.l"
+ { DPC->disk->is_cdrom = 1; }
+ 	YY_BREAK
+ case 4:
+ YY_RULE_SETUP
+-#line 177 "libxlu_disk_l.l"
++#line 188 "libxlu_disk_l.l"
+ { DPC->disk->is_cdrom = 1; }
+ 	YY_BREAK
+ case 5:
+ YY_RULE_SETUP
+-#line 178 "libxlu_disk_l.l"
++#line 189 "libxlu_disk_l.l"
+ { DPC->disk->is_cdrom = 0; }
+ 	YY_BREAK
+ case 6:
+ /* rule 6 can match eol */
+ YY_RULE_SETUP
+-#line 179 "libxlu_disk_l.l"
++#line 190 "libxlu_disk_l.l"
+ { xlu__disk_err(DPC,yytext,"unknown value for type"); }
+ 	YY_BREAK
+ case 7:
+ /* rule 7 can match eol */
+ YY_RULE_SETUP
+-#line 181 "libxlu_disk_l.l"
++#line 192 "libxlu_disk_l.l"
+ { STRIP(','); setaccess(DPC, FROMEQUALS); }
+ 	YY_BREAK
+ case 8:
+ /* rule 8 can match eol */
+ YY_RULE_SETUP
+-#line 182 "libxlu_disk_l.l"
++#line 193 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("backend", backend_domname, FROMEQUALS); }
+ 	YY_BREAK
+ case 9:
+ /* rule 9 can match eol */
+ YY_RULE_SETUP
+-#line 183 "libxlu_disk_l.l"
++#line 194 "libxlu_disk_l.l"
+ { STRIP(','); setbackendtype(DPC,FROMEQUALS); }
+ 	YY_BREAK
+ case 10:
+ /* rule 10 can match eol */
+ YY_RULE_SETUP
+-#line 185 "libxlu_disk_l.l"
++#line 196 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("vdev", vdev, FROMEQUALS); }
+ 	YY_BREAK
+ case 11:
+ /* rule 11 can match eol */
+ YY_RULE_SETUP
+-#line 186 "libxlu_disk_l.l"
++#line 197 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("script", script, FROMEQUALS); }
+ 	YY_BREAK
+ case 12:
+ YY_RULE_SETUP
+-#line 187 "libxlu_disk_l.l"
++#line 198 "libxlu_disk_l.l"
+ { DPC->disk->direct_io_safe = 1; }
+ 	YY_BREAK
+ case 13:
+ YY_RULE_SETUP
+-#line 188 "libxlu_disk_l.l"
++#line 199 "libxlu_disk_l.l"
+ { libxl_defbool_set(&DPC->disk->discard_enable, true); }
+ 	YY_BREAK
+ case 14:
+ YY_RULE_SETUP
+-#line 189 "libxlu_disk_l.l"
++#line 200 "libxlu_disk_l.l"
+ { libxl_defbool_set(&DPC->disk->discard_enable, false); }
+ 	YY_BREAK
+ /* Note that the COLO configuration settings should be considered unstable.
+   * They may change incompatibly in future versions of Xen. */
+ case 15:
+ YY_RULE_SETUP
+-#line 192 "libxlu_disk_l.l"
++#line 203 "libxlu_disk_l.l"
+ { libxl_defbool_set(&DPC->disk->colo_enable, true); }
+ 	YY_BREAK
+ case 16:
+ YY_RULE_SETUP
+-#line 193 "libxlu_disk_l.l"
++#line 204 "libxlu_disk_l.l"
+ { libxl_defbool_set(&DPC->disk->colo_enable, false); }
+ 	YY_BREAK
+ case 17:
+ /* rule 17 can match eol */
+ YY_RULE_SETUP
+-#line 194 "libxlu_disk_l.l"
++#line 205 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("colo-host", colo_host, FROMEQUALS); }
+ 	YY_BREAK
+ case 18:
+ /* rule 18 can match eol */
+ YY_RULE_SETUP
+-#line 195 "libxlu_disk_l.l"
++#line 206 "libxlu_disk_l.l"
+ { STRIP(','); setcoloport(DPC, FROMEQUALS); }
+ 	YY_BREAK
+ case 19:
+ /* rule 19 can match eol */
+ YY_RULE_SETUP
+-#line 196 "libxlu_disk_l.l"
++#line 207 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("colo-export", colo_export, FROMEQUALS); }
+ 	YY_BREAK
+ case 20:
+ /* rule 20 can match eol */
+ YY_RULE_SETUP
+-#line 197 "libxlu_disk_l.l"
++#line 208 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("active-disk", active_disk, FROMEQUALS); }
+ 	YY_BREAK
+ case 21:
+ /* rule 21 can match eol */
+ YY_RULE_SETUP
+-#line 198 "libxlu_disk_l.l"
++#line 209 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("hidden-disk", hidden_disk, FROMEQUALS); }
+ 	YY_BREAK
+ /* the target magic parameter, eats the rest of the string */
+ case 22:
+ YY_RULE_SETUP
+-#line 202 "libxlu_disk_l.l"
++#line 213 "libxlu_disk_l.l"
+ { STRIP(','); SAVESTRING("target", pdev_path, FROMEQUALS); }
+ 	YY_BREAK
+ /* unknown parameters */
+ case 23:
+ /* rule 23 can match eol */
+ YY_RULE_SETUP
+-#line 206 "libxlu_disk_l.l"
++#line 217 "libxlu_disk_l.l"
+ { xlu__disk_err(DPC,yytext,"unknown parameter"); }
+ 	YY_BREAK
+ /* deprecated prefixes */
+@@ -1505,7 +1514,7 @@ YY_RULE_SETUP
+    * matched the whole string, so these patterns take precedence */
+ case 24:
+ YY_RULE_SETUP
+-#line 213 "libxlu_disk_l.l"
++#line 224 "libxlu_disk_l.l"
+ {
+                     STRIP(':');
+                     DPC->had_depr_prefix=1; DEPRECATE("use `[format=]...,'");
+@@ -1514,7 +1523,7 @@ YY_RULE_SETUP
+ 	YY_BREAK
+ case 25:
+ YY_RULE_SETUP
+-#line 219 "libxlu_disk_l.l"
++#line 230 "libxlu_disk_l.l"
+ {
+                     char *newscript;
+                     STRIP(':');
+@@ -1533,12 +1542,12 @@ case 26:
+ yyg->yy_c_buf_p = yy_cp = yy_bp + 8;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 232 "libxlu_disk_l.l"
++#line 243 "libxlu_disk_l.l"
+ { DPC->had_depr_prefix=1; DEPRECATE(0); }
+ 	YY_BREAK
+ case 27:
+ YY_RULE_SETUP
+-#line 233 "libxlu_disk_l.l"
++#line 244 "libxlu_disk_l.l"
+ { DPC->had_depr_prefix=1; DEPRECATE(0); }
+ 	YY_BREAK
+ case 28:
+@@ -1546,7 +1555,7 @@ case 28:
+ yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 234 "libxlu_disk_l.l"
++#line 245 "libxlu_disk_l.l"
+ { DPC->had_depr_prefix=1; DEPRECATE(0); }
+ 	YY_BREAK
+ case 29:
+@@ -1554,7 +1563,7 @@ case 29:
+ yyg->yy_c_buf_p = yy_cp = yy_bp + 6;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 235 "libxlu_disk_l.l"
++#line 246 "libxlu_disk_l.l"
+ { DPC->had_depr_prefix=1; DEPRECATE(0); }
+ 	YY_BREAK
+ case 30:
+@@ -1562,7 +1571,7 @@ case 30:
+ yyg->yy_c_buf_p = yy_cp = yy_bp + 5;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 236 "libxlu_disk_l.l"
++#line 247 "libxlu_disk_l.l"
+ { DPC->had_depr_prefix=1; DEPRECATE(0); }
+ 	YY_BREAK
+ case 31:
+@@ -1570,13 +1579,13 @@ case 31:
+ yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ YY_RULE_SETUP
+-#line 237 "libxlu_disk_l.l"
++#line 248 "libxlu_disk_l.l"
+ { DPC->had_depr_prefix=1; DEPRECATE(0); }
+ 	YY_BREAK
+ case 32:
+ /* rule 32 can match eol */
+ YY_RULE_SETUP
+-#line 239 "libxlu_disk_l.l"
++#line 250 "libxlu_disk_l.l"
+ {
+ 		  xlu__disk_err(DPC,yytext,"unknown deprecated disk prefix");
+ 		  return 0;
+@@ -1586,7 +1595,7 @@ YY_RULE_SETUP
+ case 33:
+ /* rule 33 can match eol */
+ YY_RULE_SETUP
+-#line 246 "libxlu_disk_l.l"
++#line 257 "libxlu_disk_l.l"
+ {
+     STRIP(',');
+ 
+@@ -1615,7 +1624,7 @@ YY_RULE_SETUP
+ 	YY_BREAK
+ case 34:
+ YY_RULE_SETUP
+-#line 272 "libxlu_disk_l.l"
++#line 283 "libxlu_disk_l.l"
+ {
+     BEGIN(LEXERR);
+     yymore();
+@@ -1623,17 +1632,17 @@ YY_RULE_SETUP
+ 	YY_BREAK
+ case 35:
+ YY_RULE_SETUP
+-#line 276 "libxlu_disk_l.l"
++#line 287 "libxlu_disk_l.l"
+ {
+     xlu__disk_err(DPC,yytext,"bad disk syntax"); return 0;
+ }
+ 	YY_BREAK
+ case 36:
+ YY_RULE_SETUP
+-#line 279 "libxlu_disk_l.l"
++#line 290 "libxlu_disk_l.l"
+ YY_FATAL_ERROR( "flex scanner jammed" );
+ 	YY_BREAK
+-#line 1637 "libxlu_disk_l.c"
++#line 1646 "libxlu_disk_l.c"
+ 			case YY_STATE_EOF(INITIAL):
+ 			case YY_STATE_EOF(LEXERR):
+ 				yyterminate();
+@@ -1765,7 +1774,6 @@ YY_FATAL_ERROR( "flex scanner jammed" );
+ 			"fatal flex scanner internal error--no action found" );
+ 	} /* end of action switch */
+ 		} /* end of scanning one token */
+-	} /* end of user's declarations */
+ } /* end of xlu__disk_yylex */
+ 
+ /* yy_get_next_buffer - try to read in a new buffer
+@@ -1778,9 +1786,9 @@ YY_FATAL_ERROR( "flex scanner jammed" );
+ static int yy_get_next_buffer (yyscan_t yyscanner)
+ {
+     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+-	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+-	register char *source = yyg->yytext_ptr;
+-	register int number_to_move, i;
++	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
++	char *source = yyg->yytext_ptr;
++	int number_to_move, i;
+ 	int ret_val;
+ 
+ 	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+@@ -1822,7 +1830,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 
+ 	else
+ 		{
+-			int num_to_read =
++			yy_size_t num_to_read =
+ 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+ 
+ 		while ( num_to_read <= 0 )
+@@ -1883,8 +1891,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 
+     static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+ {
+-	register yy_state_type yy_current_state;
+-	register char *yy_cp;
++	yy_state_type yy_current_state;
++	char *yy_cp;
+     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ 
+ 	yy_current_state = yyg->yy_start;
+@@ -1894,7 +1902,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+ 
+ 	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+ 		{
+-		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
++		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ 		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ 			{
+ 			yy_current_state = (int) yy_def[yy_current_state];
+@@ -1915,10 +1923,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
+  */
+     static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
+ {
+-	register int yy_is_jam;
++	int yy_is_jam;
+     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+ 
+-	register YY_CHAR yy_c = 1;
++	YY_CHAR yy_c = 1;
+ 	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ 		{
+ 		yy_current_state = (int) yy_def[yy_current_state];
+@@ -2682,7 +2690,7 @@ int xlu__disk_yylex_destroy  (yyscan_t yyscanner)
+ #ifndef yytext_ptr
+ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+ {
+-	register int i;
++	int i;
+ 	for ( i = 0; i < n; ++i )
+ 		s1[i] = s2[i];
+ }
+@@ -2691,7 +2699,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
+ #ifdef YY_NEED_STRLEN
+ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+ {
+-	register int n;
++	int n;
+ 	for ( n = 0; s[n]; ++n )
+ 		;
+ 
+@@ -2723,4 +2731,4 @@ void xlu__disk_yyfree (void * ptr , yyscan_t yyscanner)
+ 
+ #define YYTABLES_NAME "yytables"
+ 
+-#line 278 "libxlu_disk_l.l"
++#line 290 "libxlu_disk_l.l"
+diff --git a/tools/libxl/libxlu_disk_l.h b/tools/libxl/libxlu_disk_l.h
+index 4d60d5c563..74e1828f24 100644
+--- a/tools/libxl/libxlu_disk_l.h
++++ b/tools/libxl/libxlu_disk_l.h
+@@ -17,13 +17,23 @@
+ #define FLEX_SCANNER
+ #define YY_FLEX_MAJOR_VERSION 2
+ #define YY_FLEX_MINOR_VERSION 5
+-#define YY_FLEX_SUBMINOR_VERSION 39
++#define YY_FLEX_SUBMINOR_VERSION 37
+ #if YY_FLEX_SUBMINOR_VERSION > 0
+ #define FLEX_BETA
+ #endif
+ 
+ /* First, we deal with  platform-specific or compiler-specific issues. */
+ 
++#if defined(__FreeBSD__)
++#ifndef __STDC_LIMIT_MACROS
++#define	__STDC_LIMIT_MACROS
++#endif
++#include <sys/cdefs.h>
++#include <stdint.h>
++#else
++#define	__dead2
++#endif
++
+ /* begin standard C headers. */
+ #include <stdio.h>
+ #include <string.h>
+@@ -39,7 +49,8 @@
+ 
+ /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+ 
+-#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
++#if defined(__FreeBSD__) || \
++    (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
+ 
+ /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+  * if you want the limit (max/min) macros for int types. 
+@@ -136,15 +147,7 @@ typedef void* yyscan_t;
+ 
+ /* Size of default input buffer. */
+ #ifndef YY_BUF_SIZE
+-#ifdef __ia64__
+-/* On IA-64, the buffer size is 16k, not 8k.
+- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+- * Ditto for the __ia64__ case accordingly.
+- */
+-#define YY_BUF_SIZE 32768
+-#else
+ #define YY_BUF_SIZE 16384
+-#endif /* __ia64__ */
+ #endif
+ 
+ #ifndef YY_TYPEDEF_YY_BUFFER_STATE
+@@ -310,12 +313,7 @@ static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+ 
+ /* Amount of stuff to slurp up with each read. */
+ #ifndef YY_READ_BUF_SIZE
+-#ifdef __ia64__
+-/* On IA-64, the buffer size is 16k, not 8k */
+-#define YY_READ_BUF_SIZE 16384
+-#else
+ #define YY_READ_BUF_SIZE 8192
+-#endif /* __ia64__ */
+ #endif
+ 
+ /* Number of entries by which start-condition stack grows. */
+@@ -348,8 +346,8 @@ extern int xlu__disk_yylex (yyscan_t yyscanner);
+ #undef YY_DECL
+ #endif
+ 
+-#line 278 "libxlu_disk_l.l"
++#line 290 "libxlu_disk_l.l"
+ 
+-#line 354 "libxlu_disk_l.h"
++#line 352 "libxlu_disk_l.h"
+ #undef xlu__disk_yyIN_HEADER
+ #endif /* xlu__disk_yyHEADER_H */
+diff --git a/tools/libxl/libxlu_disk_l.l b/tools/libxl/libxlu_disk_l.l
+index 97039a2800..7a46f4a30c 100644
+--- a/tools/libxl/libxlu_disk_l.l
++++ b/tools/libxl/libxlu_disk_l.l
+@@ -36,6 +36,17 @@
+ 
+ #define YY_NO_INPUT
+ 
++/* The code generated by flex is missing braces in single line expressions and
++ * is not properly indented, which triggers the clang misleading-indentation
++ * check that has been made part of -Wall since clang 10. In order to safely
++ * disable it on clang versions that don't have the diagnostic implemented
++ * also disable the unknown option and pragma warning. */
++#ifdef __clang__
++# pragma clang diagnostic ignored "-Wunknown-pragmas"
++# pragma clang diagnostic ignored "-Wunknown-warning-option"
++# pragma clang diagnostic ignored "-Wmisleading-indentation"
++#endif
++
+ /* Some versions of flex have a bug (Fedora bugzilla 612465) which causes
+  * it to fail to declare these functions, which it defines.  So declare
+  * them ourselves.  Hopefully we won't have to simultaneously support
+-- 
+2.26.2
+



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202005131225.04DCPahT091317>