Skip to content

Commit

Permalink
Makefile.am: also compile yacc/bison files with special warnings
Browse files Browse the repository at this point in the history
Just as for flex, the yacc/bison files produce code that generates
warnings during the build. These warnings show up when compiling
with clang version 18 or later. Since we can't change the code
produced by these tools, we need to disable some compile warnings
for these files.
  • Loading branch information
rsto committed Feb 5, 2025
1 parent 6989856 commit 2a011eb
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1825,16 +1825,17 @@ endif
# sources only.
sieve_libcyrus_sieve_lex_la_SOURCES = \
sieve/addr-lex.l \
sieve/sieve-lex.l
sieve/sieve-lex.l \
sieve/addr.y \
sieve/sieve.y
sieve_libcyrus_sieve_lex_la_LIBADD =
sieve_libcyrus_sieve_lex_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) $(NOWARN_SIGN_COMPARE)
sieve_libcyrus_sieve_lex_la_CFLAGS = $(AM_CFLAGS) $(CFLAG_VISIBILITY) $(NOWARN_SIGN_COMPARE) $(NOWARN_UNUSED_BUT_SET)

nodist_sieve_libcyrus_sieve_la_SOURCES = \
sieve/sieve_err.c \
sieve/sieve_err.h
sieve_libcyrus_sieve_la_SOURCES = \
sieve/bytecode.h \
sieve/addr.y \
sieve/bc_emit.c \
sieve/bc_eval.c \
sieve/bc_generate.c \
Expand All @@ -1852,7 +1853,6 @@ sieve_libcyrus_sieve_la_SOURCES = \
sieve/message.h \
sieve/script.c \
sieve/script.h \
sieve/sieve.y \
sieve/tree.c \
sieve/tree.h \
sieve/variables.c \
Expand Down
15 changes: 15 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,21 @@ AC_COMPILE_IFELSE(
CFLAGS="$saved_CFLAGS"
AC_SUBST([NOWARN_SIGN_COMPARE])

dnl look for an option to disable sign-comparison warnings (needed for
dnl flex-generated sieve sources when building with -Werror)
saved_CFLAGS="$CFLAGS"
NOWARN_UNUSED_BUT_SET="-Wno-unused-but-set-variable"
CFLAGS="$NOWARN_UNUSED_BUT_SET"
AC_MSG_CHECKING([whether the C compiler supports -Wno-unused-but-set-variable])
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([], [])],
[AC_MSG_RESULT([yes])],
[NOWARN_UNUSED_BUT_SET=]
[AC_MSG_RESULT([no])]
)
CFLAGS="$saved_CFLAGS"
AC_SUBST([NOWARN_UNUSED_BUT_SET])

dnl for et routines
AC_FUNC_CHECK(strerror,AC_DEFINE(HAS_STRERROR,[],[Do we have strerror()?]),
AC_DEFINE(NEED_SYS_ERRLIST,[],[Do we have a sys_errlist?]))
Expand Down

0 comments on commit 2a011eb

Please sign in to comment.