Skip to content

Commit

Permalink
Revert "Build Flex-generated files with "warnings are errors"."
Browse files Browse the repository at this point in the history
This reverts commit b56f538.

Sadly, we *do* get warnings at this point with older versions of Flex,
such as the one on the 32-bit OS X buildbot.

Change-Id: I9aec1a16e9f2e1bbcfaac3dffdabdd89af5815e3
Reviewed-on: https://code.wireshark.org/review/12443
Reviewed-by: Guy Harris <[email protected]>
  • Loading branch information
guyharris committed Dec 5, 2015
1 parent b7d1eed commit d7006ce
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 61 deletions.
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1602,17 +1602,17 @@ else()
endif(WIN32)

# Create help/faq.txt when missing
#add_custom_command(OUTPUT "${DATAFILE_DIR}/help/faq.txt"
# COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/help/faq.py -b > faq.tmp.html
# COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
# faq.tmp.html > "${DATAFILE_DIR}/help/faq.txt"
# COMMAND ${CMAKE_COMMAND} -E remove faq.tmp.html
# DEPENDS
# "${CMAKE_SOURCE_DIR}/help/faq.py"
# "${CMAKE_SOURCE_DIR}/tools/html2text.py"
#)
#list(APPEND copy_data_files_depends "${DATAFILE_DIR}/help/faq.txt")
add_custom_command(OUTPUT "${DATAFILE_DIR}/help/faq.txt"
COMMAND ${CMAKE_COMMAND} -E make_directory "${DATAFILE_DIR}/help"
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/help/faq.py -b > faq.tmp.html
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/tools/html2text.py
faq.tmp.html > "${DATAFILE_DIR}/help/faq.txt"
COMMAND ${CMAKE_COMMAND} -E remove faq.tmp.html
DEPENDS
"${CMAKE_SOURCE_DIR}/help/faq.py"
"${CMAKE_SOURCE_DIR}/tools/html2text.py"
)
list(APPEND copy_data_files_depends "${DATAFILE_DIR}/help/faq.txt")

# Install LUA files in staging directory such that LUA can used when Wireshark
# is ran from the build directory. For install targets, see
Expand Down
16 changes: 8 additions & 8 deletions epan/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,14 @@ set(DFILTER_FILES
)
source_group(dfilter FILES ${DFILTER_FILES})

add_lex_files(DFILTER_FILES
dfilter/scanner.l
)

set(DFILTER_CLEAN_FILES
${DFILTER_FILES}
)

add_lex_files(DFILTER_FILES
dfilter/scanner.l
)

add_lemon_files(DFILTER_FILES
dfilter/grammar.lemon
)
Expand Down Expand Up @@ -1667,6 +1667,10 @@ set(LIBWIRESHARK_FILES
xdlc.c
)

set(LIBWIRESHARK_CLEAN_FILES
${LIBWIRESHARK_FILES}
)

add_lex_files(LIBWIRESHARK_FILES
diam_dict.l
dtd_parse.l
Expand All @@ -1675,10 +1679,6 @@ add_lex_files(LIBWIRESHARK_FILES
uat_load.l
)

set(LIBWIRESHARK_CLEAN_FILES
${LIBWIRESHARK_FILES}
)

add_lemon_files(LIBWIRESHARK_FILES
dtd_grammar.lemon
)
Expand Down
26 changes: 18 additions & 8 deletions epan/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ DIST_SUBDIRS = $(SUBDIRS) $(wslua_dist_dir)

ACLOCAL_AMFLAGS = `../aclocal-flags`

noinst_LTLIBRARIES = libwireshark_asmopt.la
noinst_LTLIBRARIES = libwireshark_generated.la libwireshark_asmopt.la
lib_LTLIBRARIES = libwireshark.la
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libwireshark_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@
Expand All @@ -50,19 +50,26 @@ AM_CPPFLAGS = -I$(srcdir)/.. -I$(srcdir)/$(LEMON) -I$(builddir)/wslua \
@LUA_CFLAGS@ $(LIBGNUTLS_CFLAGS) $(LIBGCRYPT_CFLAGS) \
$(LIBSMI_CFLAGS) $(LIBGEOIP_CFLAGS) $(PY_CFLAGS)

AM_CFLAGS =-DWS_BUILD_DLL
AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL

if HAVE_WARNINGS_AS_ERRORS
AM_CFLAGS += -Werror
AM_NON_GENERATED_CFLAGS += -Werror
endif

#Since code generated by lex may trigger gcc warnings, we are now generating two
#libraries. A single library is generated with the lex code without the barrier
#"stop on warning". An other library is generated from the remaining source
#files with the "stop on warning" barrier.
libwireshark_la_SOURCES = \
$(LIBWIRESHARK_SRC) \
$(LIBWIRESHARK_INCLUDES) \
$(LIBWIRESHARK_GENERATED_C_FILES) \
$(LIBWIRESHARK_SRC) \
$(LIBWIRESHARK_INCLUDES)
libwireshark_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)

libwireshark_generated_la_SOURCES = \
$(LIBWIRESHARK_GENERATED_C_FILES) \
$(LIBWIRESHARK_GENERATED_HEADER_FILES)

nodist_libwireshark_la_SOURCES = \
nodist_libwireshark_generated_la_SOURCES = \
$(NODIST_LIBWIRESHARK_GENERATED_C_FILES) \
$(NODIST_LIBWIRESHARK_GENERATED_HEADER_FILES)

Expand Down Expand Up @@ -96,6 +103,8 @@ CLEANFILES = \
doxygen-epan.tag \
libwireshark.a \
libwireshark.la \
libwireshark_generated.a \
libwireshark_generated.la \
libwireshark_asmopt.a \
libwireshark_asmopt.la \
*~
Expand All @@ -114,6 +123,7 @@ MAINTAINERCLEANFILES = \
# Add the object files for missing routines, if any.
#
libwireshark_la_LIBADD = \
libwireshark_generated.la \
libwireshark_asmopt.la crypt/libairpdcap.la \
ftypes/libftypes.la dfilter/libdfilter.la dissectors/libdissectors.la \
dissectors/libdirtydissectors.la dissectors/libfiledissectors.la \
Expand All @@ -125,7 +135,7 @@ libwireshark_la_LIBADD = \
${top_builddir}/wsutil/libwsutil.la -lm

libwireshark_la_DEPENDENCIES = \
compress/liblzxpress.la\
libwireshark_generated.la compress/liblzxpress.la\
libwireshark_asmopt.la crypt/libairpdcap.la \
ftypes/libftypes.la dfilter/libdfilter.la dissectors/libdissectors.la \
dissectors/libdirtydissectors.la nghttp2/libnghttp2.la \
Expand Down
29 changes: 20 additions & 9 deletions epan/Makefile.nmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,36 @@ LINK= link
#
# These are the flags for all source files.
#
COMMON_CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \
COMMON_CFLAGS=\
$(STANDARD_CFLAGS) \
/I. /I.. /I../wiretap $(GLIB_CFLAGS) \
$(ZLIB_CFLAGS) $(C_ARES_CFLAGS) $(ADNS_CFLAGS) \
$(LUA_CFLAGS) $(GNUTLS_CFLAGS) /I$(PCAP_DIR)\include \
$(SMI_CFLAGS) $(GEOIP_CFLAGS)

#
# These are the flags for generated source files; we don't include
# $(WARNINGS_ARE_ERRORS), so that we flex's non-LLP64-compliant output
# doesn't cause compilation to fail.
#
GENERATED_CFLAGS=\
$(COMMON_CFLAGS) -DWS_BUILD_DLL

#
# These are the flags for test programs; we don't include -DWS_BUILD_DLL,
# as we're building test programs that link with the library, not routines
# incorporated into the library, so they should *import* stuff from the
# library, not *export* stuff from the library.
#
TEST_CFLAGS=$(COMMON_CFLAGS)
TEST_CFLAGS=\
$(WARNINGS_ARE_ERRORS) $(COMMON_CFLAGS)

#
# These are flags for everything else; we include -DWS_BUILD_DLL,
# These are flags for everything else; we include $(WARNINGS_ARE_ERRORS),
# as the code should be warning-free, and we include -DWS_BUILD_DLL,
# as these are library routines, not test programs.
#
CFLAGS=$(COMMON_CFLAGS) -DWS_BUILD_DLL
CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS) -DWS_BUILD_DLL

!IFDEF LUA_DIR
WSLUA_LIB=wslua\wslua.lib
Expand Down Expand Up @@ -390,7 +401,7 @@ RUNLEX=../tools/runlex.sh
#
diam_dict_lex.h: diam_dict.c
diam_dict.obj : diam_dict.c
$(CC) $(CFLAGS) -Fd.\ -c $?
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?

#
# This depends on dtd_grammar.h to force dtd_grammar.h to be
Expand All @@ -402,19 +413,19 @@ diam_dict.obj : diam_dict.c
dtd_parse_lex.h: dtd_parse.c
dtd_parse.obj : dtd_grammar.h
dtd_parse.obj : dtd_parse.c
$(CC) $(CFLAGS) -Fd.\ -c dtd_parse.c
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c dtd_parse.c

dtd_preparse_lex.h: dtd_preparse.c
dtd_preparse.obj : dtd_preparse.c
$(CC) $(CFLAGS) -Fd.\ -c $?
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?

radius_dict_lex.h: radius_dict.c
radius_dict.obj : radius_dict.c
$(CC) $(CFLAGS) -Fd.\ -c $?
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?

uat_load_lex.h: uat_load.c
uat_load.obj : uat_load.c
$(CC) $(CFLAGS) -Fd.\ -c $?
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c $?

LEMON=..\tools\lemon

Expand Down
24 changes: 17 additions & 7 deletions epan/dfilter/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,18 @@
include ../../Makefile.am.inc

if HAVE_WARNINGS_AS_ERRORS
AM_CFLAGS = -Werror
AM_NON_GENERATED_CFLAGS = -Werror
endif

include Makefile.common

noinst_LTLIBRARIES = libdfilter.la
noinst_LTLIBRARIES = libdfilter_generated.la libdfilter.la

CLEANFILES = \
libdfilter.a \
libdfilter.la \
libdfilter_generated.a \
libdfilter_generated.la \
*~

DISTCLEANFILES = \
Expand All @@ -45,16 +47,24 @@ MAINTAINERCLEANFILES = \

AM_CPPFLAGS = -I$(srcdir)/../.. -I$(srcdir)/.. -I$(srcdir)/$(LEMON)

libdfilter_la_SOURCES = \
$(NONGENERATED_C_FILES) \
$(NONGENERATED_HEADER_FILES) \
$(GENERATED_C_FILES) \
#Since code generated by lex may trigger gcc warnings, we are now generating two
#libraries. A single library is generated with the lex code without the barrier
#"stop on warning". An other library is generated from the remaining source
#files with the "stop on warning" barrier.
libdfilter_la_SOURCES = $(NONGENERATED_C_FILES) $(NONGENERATED_HEADER_FILES)
libdfilter_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)

libdfilter_generated_la_SOURCES = \
$(GENERATED_C_FILES) \
$(GENERATED_HEADER_FILES)

nodist_libdfilter_la_SOURCES = \
nodist_libdfilter_generated_la_SOURCES = \
$(NODIST_GENERATED_C_FILES) \
$(NODIST_GENERATED_HEADER_FILES)

libdfilter_la_LIBADD = libdfilter_generated.la
libdfilter_la_DEPENDENCIES = libdfilter_generated.la

EXTRA_DIST = \
$(GENERATOR_FILES) \
Makefile.common \
Expand Down
8 changes: 6 additions & 2 deletions epan/dfilter/Makefile.nmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ include Makefile.common

LEMON=..\..\tools\lemon

CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \
# We GENERATED_CFLAGS to get around flex's non-LLP64-compliant output
GENERATED_CFLAGS=\
$(STANDARD_CFLAGS) \
/I. /I.. /I..\.. $(GLIB_CFLAGS) \
/I$(LEMON) \
/I$(PCAP_DIR)\include \
-DWS_BUILD_DLL

CFLAGS=$(WARNINGS_ARE_ERRORS) $(GENERATED_CFLAGS)

.c.obj::
$(CC) $(CFLAGS) -Fd.\ -c $<

Expand Down Expand Up @@ -58,7 +62,7 @@ RUNLEX=../../tools/runlex.sh

scanner_lex.h : scanner.c
scanner.obj : scanner.c grammar.h
$(CC) $(CFLAGS) -Fd.\ -c scanner.c
$(CC) $(GENERATED_CFLAGS) -Fd.\ -c scanner.c

scanner.c: grammar.h

Expand Down
10 changes: 5 additions & 5 deletions wiretap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,6 @@ set(WIRETAP_FILES
wtap.c
)

add_lex_files(WIRETAP_FILES
ascend_scanner.l
k12text.l
)

if (WERROR_COMMON_FLAGS)
set_source_files_properties(
${WIRETAP_FILES}
Expand All @@ -94,6 +89,11 @@ if (WERROR_COMMON_FLAGS)
)
endif()

add_lex_files(WIRETAP_FILES
ascend_scanner.l
k12text.l
)

add_yacc_files(WIRETAP_FILES
ascend.y
)
Expand Down
25 changes: 17 additions & 8 deletions wiretap/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,41 @@ ACLOCAL_AMFLAGS = `../aclocal-flags`

include Makefile.common

noinst_LTLIBRARIES = libwiretap_generated.la
lib_LTLIBRARIES = libwiretap.la
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
libwiretap_la_LDFLAGS = -version-info 0:0:0 @LDFLAGS_SHAREDLIB@

AM_CFLAGS =-DWS_BUILD_DLL
AM_NON_GENERATED_CFLAGS =-DWS_BUILD_DLL

if HAVE_WARNINGS_AS_ERRORS
AM_CFLAGS += -Werror
AM_NON_GENERATED_CFLAGS += -Werror
endif

AM_CPPFLAGS = -I$(srcdir)/..

CLEANFILES = \
libwiretap.a \
libwiretap.la \
libwiretap_generated.a \
libwiretap_generated.la \
*~

MAINTAINERCLEANFILES = \
$(GENERATED_FILES) \
Makefile.in

#Since code generated by lex may trigger gcc warnings, we are now generating two
#libraries. A single library is generated with the lex code without the barrier
#"stop on warning". An other library is generated from the remaining source
#files with the "stop on warning" barrier.
libwiretap_la_SOURCES = \
$(NONGENERATED_C_FILES) \
$(NONGENERATED_HEADER_FILES) \
$(GENERATED_C_FILES) \
$(GENERATED_HEADER_FILES)
$(NONGENERATED_C_FILES) \
$(NONGENERATED_HEADER_FILES)
libwiretap_la_CFLAGS = $(AM_NON_GENERATED_CFLAGS)

libwiretap_generated_la_SOURCES = \
$(GENERATED_C_FILES)

EXTRA_DIST = \
README.airmagnet \
Expand All @@ -60,8 +69,8 @@ EXTRA_DIST = \
$(GENERATOR_FILES) \
$(GENERATED_FILES)

libwiretap_la_LIBADD = ${top_builddir}/wsutil/libwsutil.la $(GLIB_LIBS)
libwiretap_la_DEPENDENCIES = ${top_builddir}/wsutil/libwsutil.la
libwiretap_la_LIBADD = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la $(GLIB_LIBS)
libwiretap_la_DEPENDENCIES = libwiretap_generated.la ${top_builddir}/wsutil/libwsutil.la

RUNLEX = $(top_srcdir)/tools/runlex.sh

Expand Down
Loading

0 comments on commit d7006ce

Please sign in to comment.