All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex
@ 2012-07-29  6:30 Lucas De Marchi
  2012-07-29  6:30 ` [PATCH BlueZ 2/2] build-sys: Don't use -Werror for generated lexer.c Lucas De Marchi
  2012-07-29 16:31 ` [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex Marcel Holtmann
  0 siblings, 2 replies; 3+ messages in thread
From: Lucas De Marchi @ 2012-07-29  6:30 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

Flex 2.5.36 no longer defines isatty(), resulting in the following build
error:

	tools/lexer.c:1402:9: error: implicit declaration of function
	‘isatty’ [-Werror=implicit-function-declaration]

Include the header unistd.h so we get the definition of that function
and at the same time keep the fix for older versions of flex, since this
header defines _UNISTD_H.
---
 tools/lexer.l | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/tools/lexer.l b/tools/lexer.l
index ff9ce81..0d449ac 100644
--- a/tools/lexer.l
+++ b/tools/lexer.l
@@ -26,9 +26,7 @@
 #include <config.h>
 #endif
 
-/* Nasty workaround, but flex defines isatty() twice */
-#define _UNISTD_H
-
+#include <unistd.h>
 #include <stdio.h>
 #include <errno.h>
 #include <sys/socket.h>
-- 
1.7.11.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH BlueZ 2/2] build-sys: Don't use -Werror for generated lexer.c
  2012-07-29  6:30 [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex Lucas De Marchi
@ 2012-07-29  6:30 ` Lucas De Marchi
  2012-07-29 16:31 ` [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Lucas De Marchi @ 2012-07-29  6:30 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Lucas De Marchi

Source files that are generated by tools can't be compiled with -Werror
because we can't really fix the issue in version of the tools that was
already release and is used by distributions.

After updating to flex 2.5.36 the following error occurs:

	tools/lexer.c:1599:17: error: comparison between signed and
	unsigned integer expressions [-Werror=sign-compare]

Override -Werror with -Wno-error for this specific file so warning is
still emitted but we no longer fail the build.
---
 Makefile.tools | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/Makefile.tools b/Makefile.tools
index 5579b86..1499bf7 100644
--- a/Makefile.tools
+++ b/Makefile.tools
@@ -14,11 +14,15 @@ noinst_PROGRAMS += tools/avinfo tools/ppporc \
 
 tools/kword.c: tools/parser.h
 
-tools_rfcomm_SOURCES = tools/rfcomm.c tools/parser.y tools/lexer.l \
-					tools/kword.h tools/kword.c
+noinst_LTLIBRARIES += tools/librfcomm-lexer.la
+tools_librfcomm_lexer_la_SOURCES = tools/lexer.l
+tools_librfcomm_lexer_la_CFLAGS = $(AM_CFLAGS) -Wno-error
+
+tools_rfcomm_SOURCES = tools/rfcomm.c tools/parser.y tools/kword.h \
+							tools/kword.c
 EXTRA_tools_rfcomm_SOURCES = tools/parser.h tools/parser.c \
 							tools/lexer.c
-tools_rfcomm_LDADD = lib/libbluetooth-private.la
+tools_rfcomm_LDADD = lib/libbluetooth-private.la tools/librfcomm-lexer.la
 
 tools_l2ping_LDADD = lib/libbluetooth-private.la
 
-- 
1.7.11.3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex
  2012-07-29  6:30 [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex Lucas De Marchi
  2012-07-29  6:30 ` [PATCH BlueZ 2/2] build-sys: Don't use -Werror for generated lexer.c Lucas De Marchi
@ 2012-07-29 16:31 ` Marcel Holtmann
  1 sibling, 0 replies; 3+ messages in thread
From: Marcel Holtmann @ 2012-07-29 16:31 UTC (permalink / raw)
  To: Lucas De Marchi; +Cc: linux-bluetooth

Hi Lucas,

> Flex 2.5.36 no longer defines isatty(), resulting in the following build
> error:
> 
> 	tools/lexer.c:1402:9: error: implicit declaration of function
> 	‘isatty’ [-Werror=implicit-function-declaration]
> 
> Include the header unistd.h so we get the definition of that function
> and at the same time keep the fix for older versions of flex, since this
> header defines _UNISTD_H.

lets remove the rfcomm.conf support from rfcomm utility and then move it
under tools/. So no more need for flex or bison.

Regards

Marcel



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-07-29 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-29  6:30 [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex Lucas De Marchi
2012-07-29  6:30 ` [PATCH BlueZ 2/2] build-sys: Don't use -Werror for generated lexer.c Lucas De Marchi
2012-07-29 16:31 ` [PATCH BlueZ 1/2] tools: Fix workaround to build with recent flex Marcel Holtmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.